Skip to content

Commit 04d7e20

Browse files
Apply suggestions from code review
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent c161d40 commit 04d7e20

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/typing_extensions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,8 @@ class _ConcatenateGenericAlias(list):
19861986
__class__ = typing._GenericAlias
19871987

19881988
def __init__(self, origin, args):
1989+
# Cannot use `super().__init__` here because of the `__class__` assignment
1990+
# in the class body (https://github.com/python/typing_extensions/issues/661)
19891991
list.__init__(self, args)
19901992
self.__origin__ = origin
19911993
self.__args__ = args
@@ -2545,6 +2547,9 @@ def __typing_is_unpacked_typevartuple__(self):
25452547
def __getitem__(self, args):
25462548
if self.__typing_is_unpacked_typevartuple__:
25472549
return args
2550+
# Cannot use `super().__getitem__` here because of the `__class__` assignment
2551+
# in the class body on Python <=3.11
2552+
# (https://github.com/python/typing_extensions/issues/661)
25482553
return typing._GenericAlias.__getitem__(self, args)
25492554

25502555
@_UnpackSpecialForm

0 commit comments

Comments
 (0)