summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorIvan Levkivskyi <levkivskyi@gmail.com>2017-02-24 03:03:28 (GMT)
committerMariatta <Mariatta@users.noreply.github.com>2017-02-24 03:03:28 (GMT)
commitabb3b8ad94d699c8560d94ee9bac9c917b382abe (patch)
tree8032e4fe1bee448b36cfacad7c0f98579a09ca1f /Lib/typing.py
parent1aceb024172ea3d6f9dd6e90f4fbe63ea1fb054e (diff)
downloadcpython-abb3b8ad94d699c8560d94ee9bac9c917b382abe.zip
cpython-abb3b8ad94d699c8560d94ee9bac9c917b382abe.tar.gz
cpython-abb3b8ad94d699c8560d94ee9bac9c917b382abe.tar.bz2
Update to typing: treat subscripted generics as proxies (#265)
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 efe358f..fc2ed94 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