Skip to content

Introspection: properly tag modules as incomplete when needed #5207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tpt
Copy link
Contributor

@Tpt Tpt commented Jun 23, 2025

If users register "manually" some elements in the module using #[pymodule] or #[pymodule_init] functions, PyO3 is not able to introspect the full module content and stubs might be incomplete. In this case we properly tag the module as incomplete using the hack suggested in type stubs documentation, this way type checkers like Mypy won't fail on elements not listed in the stub.

@Tpt Tpt force-pushed the tpt/typing-exhaustive branch from 09da583 to 6595f19 Compare June 23, 2025 07:00
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.

1 participant