Skip to content

Commit

Permalink
[3.10] gh-94245: Fix pickling and copying of typing.Tuple[()] (GH-94260)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka authored Jun 25, 2022
1 parent 86e49a5 commit 75dda3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,8 @@ def __reduce__(self):
else:
origin = self.__origin__
args = tuple(self.__args__)
if len(args) == 1 and not isinstance(args[0], tuple):
if len(args) == 1 and (not isinstance(args[0], tuple) or
origin is Tuple and not args[0]):
args, = args
return operator.getitem, (origin, args)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix pickling and copying of ``typing.Tuple[()]``.

0 comments on commit 75dda3b

Please sign in to comment.