Skip to content

Conversation

@DinoV
Copy link
Contributor

@DinoV DinoV commented Nov 6, 2025

_PyModule_GetToken relies upon an implicit conversion from a void* to PyModuleDef *. This is totally legal but the explicit cast is a little bit better. FYI we saw this where we include this in Cinder from a C++ file.

@DinoV DinoV requested a review from vstinner November 6, 2025 14:45
@DinoV DinoV added the skip news label Nov 6, 2025
@DinoV DinoV changed the title Don't rely on implicit conversion from void * to pointer in _PyModule… gh-141150: Don't rely on implicit conversion from void * to pointer in _PyModule… Nov 6, 2025
@DinoV DinoV marked this pull request as ready for review November 6, 2025 15:10
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DinoV DinoV merged commit 13f09a6 into python:main Nov 6, 2025
52 checks passed
beneltayar pushed a commit to beneltayar/cpython that referenced this pull request Nov 6, 2025
…nter in _PyModule… (python#141147)

Don't rely on implicit conversion from void * to pointer in _PyModule_GetToken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants