Repository navigation
pickling fails for typing.Tuple[()] #94245
Copy link
Copy link
Closed
Labels
3.10 (EOL)end of lifeend of lifetopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Jun 24, 2022 Thanks for the report. I can reproduce on 3.9 and 3.10, but not a recent build of 3.11. I assume @serhiy-storchaka's changes to the representation of empty tuples fixed this issue.
We're not going to fix this for 3.9 and lower because those branches are in security fix-only mode, but we can still fix it on 3.10.
Just for completeness... here's a little more information on the bug (from the OP issue at
dill):>>> import pickle >>> import typing >>> t = typing.Tuple[()] >>> t typing.Tuple[()] >>> t = t.copy_with(()) >>> t typing.Tuple[] >>> s = pickle.dumps(t) >>> pickle.loads(s) typing.Tuple[()] >>> typing.Tuple[] File "<stdin>", line 1 typing.Tuple[] ^ SyntaxError: invalid syntax- added a commit that references this issue
on Jun 26, 2022 - added a commit that references this issue
on Jul 25, 2022
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of lifetopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Bug report
A clear and concise description of what the bug is.
Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible.
Error message:
Your environment
python 3.8
3.6 & 3.8
Mac OS