summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-08-30 17:36:16 (GMT)
committerGitHub <noreply@github.com>2022-08-30 17:36:16 (GMT)
commit4217393aeed42d67dd4b16a128528f5ca8d939c4 (patch)
treece66e2cf6cc4cd318b1eaaf77d7e6984fb80b192 /Lib/typing.py
parent6d791a97364b68d5f9c3514a0470aac487fc538d (diff)
downloadcpython-4217393aeed42d67dd4b16a128528f5ca8d939c4.zip
cpython-4217393aeed42d67dd4b16a128528f5ca8d939c4.tar.gz
cpython-4217393aeed42d67dd4b16a128528f5ca8d939c4.tar.bz2
gh-95987: Fix `repr` of `Any` type subclasses (#96412)
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 596744e..84fe007 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -493,7 +493,9 @@ class _AnyMeta(type):
return super().__instancecheck__(obj)
def __repr__(self):
- return "typing.Any"
+ if self is Any:
+ return "typing.Any"
+ return super().__repr__() # respect to subclasses
class Any(metaclass=_AnyMeta):