mirror of
https://github.com/python/cpython.git
synced 2025-08-08 02:48:55 +00:00
[3.12] gh-117110: Fix subclasses of typing.Any with custom constructors (GH-117111) (#117357)
gh-117110: Fix subclasses of typing.Any with custom constructors (GH-117111)
(cherry picked from commit 8eec7ed714
)
Co-authored-by: 傅立业(Chris Fu) <17433201@qq.com>
This commit is contained in:
parent
655c4255fc
commit
9f831f442c
3 changed files with 22 additions and 1 deletions
|
@ -544,7 +544,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue