Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@winding-lines
Copy link
Contributor

Currently if you define a __getitem__ method and export the struct to Python you 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.

@winding-lines winding-lines requested review from a team as code owners November 10, 2025 02:52
@winding-lines winding-lines force-pushed the feat/python-interop-mapping branch from 6983d88 to dcf247b Compare November 10, 2025 02:54
@winding-lines winding-lines force-pushed the feat/python-interop-mapping branch from dcf247b to d79a694 Compare November 11, 2025 17:47
@laszlokindrat laszlokindrat self-assigned this Nov 11, 2025
@winding-lines winding-lines force-pushed the feat/python-interop-mapping branch from 0bc9161 to 7f70ad2 Compare November 15, 2025 17:14
@winding-lines winding-lines force-pushed the feat/python-interop-mapping branch 5 times, most recently from 42c45ef to 110436b Compare December 4, 2025 04:40
@winding-lines winding-lines force-pushed the feat/python-interop-mapping branch from 110436b to 8f910df Compare December 6, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.