Skip to content
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

Should __module__ be defined as class attribute? #12128

Open
dvarrazzo opened this issue Jun 11, 2024 · 3 comments
Open

Should __module__ be defined as class attribute? #12128

dvarrazzo opened this issue Jun 11, 2024 · 3 comments

Comments

@dvarrazzo
Copy link

Ref.

__module__: str

This results in mypyc raising an error upon code accessing obj.__class__.__module__, which I believe is the canonical way to get the attribute. See mypyc/mypyc#1055

Note that Cython doesn't define obj.__module__, therefore it makes difficult to write portable code.

@AlexWaygood
Copy link
Member

AlexWaygood commented Jun 11, 2024

See #8787 and #8789 for previous discussion

@srittau
Copy link
Collaborator

srittau commented Jun 11, 2024

Maybe we could revisit #8789? Seems like a mypy problem that may or may not be fixed in the meantime, but should probably be fixed in any case.

@AlexWaygood
Copy link
Member

Yeah I'm definitely open to revisiting either #8787 or #8789! The current stubs are incorrect, for sure.

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

No branches or pull requests

3 participants