Making instance of TypeVar fails because of missing __name__ #84123
Copy link
Copy link
Closed
Labels
3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
Example code:
code = """ import typing T = typing.TypeVar("T") """ exec(code, {})Traceback:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<string>", line 3, in <module> File "C:\Python38\lib\typing.py", line 603, in __init__ def_mod = sys._getframe(1).f_globals['__name__'] # for pickling KeyError: '__name__'If this problem with
__name__is not something that needs to be fixed, then I also noticed that the same line in typing.py will also raise when platform doesn't havesys._getframe()- added3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Mar 12, 2020
Metadata
Metadata
Assignees
Labels
3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
TypeVarfails when missing__name__#19616TypeVarwhen missing__name__(GH-19616) #19626TypeVarwhen missing__name__(GH-19616) #19627Note: 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: