[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-04-04 Thread Ethan Furman
Ethan Furman added the comment: Takuo, please give us an example from real code so we can see the problem. -- ___ Python tracker ___

[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-04-04 Thread Ethan Furman
Ethan Furman added the comment: issue47223 and issue47224 closed, reopening this one. -- nosy: +ethan.furman resolution: duplicate -> stage: resolved -> status: closed -> open ___ Python tracker

[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-04-04 Thread Takuo Matsuoka
Takuo Matsuoka added the comment: I'm going to close this one since I failed to specify the issue clearly enough. See https://bugs.python.org/issue47224 for a more specific issue. -- resolution: -> duplicate stage: -> resolved status: open -> closed

[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-03-27 Thread Takuo Matsuoka
Takuo Matsuoka added the comment: Thank you for your response. I think __name__ here is very different from __len__ . (1) Even if you set __name__ to what should be the right value, e.g., when my class O will be a subclass of say 'type', and __name__ is an appropriate thing for your purposes

[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-03-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: > the programmer may use the variable __name__ for some other purposes Dunder names like `__name__` are reserved for the use of the interpreter. If the programmer uses them for "other purposes", the programmer is responsible for any failures. You wouldn't

[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-03-27 Thread Takuo Matsuoka
New submission from Takuo Matsuoka : In the creation of a class, it looks as if the value of the variable __name__ gets assigned automatically to the variable __module__ in the class body. However, the correct name space where the value of __name__ should be looked up is NOT the mapping object