gh-117110: Fix subclasses of typing.Any with custom constructors (#117111)

This commit is contained in:
傅立业(Chris Fu) 2024-03-29 08:19:20 +08:00 committed by GitHub
parent a17f313e39
commit 8eec7ed714
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 1 deletions

View file

@ -539,7 +539,7 @@ class Any(metaclass=_AnyMeta):
def __new__(cls, *args, **kwargs):
if cls is Any:
raise TypeError("Any cannot be instantiated")
return super().__new__(cls, *args, **kwargs)
return super().__new__(cls)
@_SpecialForm