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
Namespace inconsistency #48354
Comments
Hello See the following code and comments for explanation ;) (Try it with --- >>> class A:
... class B:
... pass
>>> A
<class __main__.A at 0x...>
>>> A.B
<class __main__.B at 0x...>
>>> B
NameError: B is not defined This seems to be inconsistent, as Python represents A.B as __main__.B, Maybe this could be better: >>> A.B
<class __main__.A.B at 0x...>
^ |
This is because type_repr looks at the __module__ attribute to determine |
I'm tempted to close this as "won't fix". |
Me too. There are too many cases where class statements can be executed |
I consider the request invalid. Continue the example with |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: