Skip to content

Commit 75dda3b

Browse files
[3.10] gh-94245: Fix pickling and copying of typing.Tuple[()] (GH-94260)
1 parent 86e49a5 commit 75dda3b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/typing.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,8 @@ def __reduce__(self):
10991099
else:
11001100
origin = self.__origin__
11011101
args = tuple(self.__args__)
1102-
if len(args) == 1 and not isinstance(args[0], tuple):
1102+
if len(args) == 1 and (not isinstance(args[0], tuple) or
1103+
origin is Tuple and not args[0]):
11031104
args, = args
11041105
return operator.getitem, (origin, args)
11051106

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

0 commit comments

Comments
 (0)