summaryrefslogtreecommitdiff
path: root/Lib/typing.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index efe358faf2..fc2ed94cff 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -1158,6 +1158,13 @@ class GenericMeta(TypingMeta, abc.ABCMeta):
self.__parameters__, self.__args__, self.__origin__,
self.__extra__, self.__orig_bases__)
+ def __setattr__(self, attr, value):
+ # We consider all the subscripted genrics as proxies for original class
+ if attr.startswith('__') and attr.endswith('__'):
+ super(GenericMeta, self).__setattr__(attr, value)
+ else:
+ super(GenericMeta, _gorg(self)).__setattr__(attr, value)
+
# Prevent checks for Generic to crash when defining Generic.
Generic = None