Closed
Description
Bug report
Bug description:
from typing import Any
class C(Any):
def __init__(self, v): ...
C(0) # TypeError: object.__new__() takes exactly one argument (the type to instantiate)
The fix should be easy. Just replace --
return super().__new__(cls, *args, **kwargs)
with --
return super().__new__(cls)
in typing.Any.__new__(...)
, as the superclass is object
and its __new__
doesn't accept additional arguments.
CPython versions tested on:
3.12
Operating systems tested on:
Linux, Windows