main ← winding-lines:feat/python-interop-mapping
opened 02:52AM - 10 Nov 25 UTC
Currently if you define a `__getitem__` method and export the struct to Python y…ou can call the
given method but you cannot use []. That's because the methods of the Mapping protocol need
to be plumbed through special `tp_slots` in the type definition.
This PR proposes an approach for how this could be done. I am not familiar with current and future
directions of the Python Interop design. There are many of these type slots here:
https://github.com/python/cpython/blob/main/Include/typeslots.h. The design should accommodate
all those.
Feedback appreciated.