Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
fromtypingimportAnyclassC(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 --
returnsuper().__new__(cls,*args,**kwargs)
with --
returnsuper().__new__(cls)
intyping.Any.__new__(...), as the superclass isobject and its__new__ doesn't accept additional arguments.
CPython versions tested on:
3.12
Operating systems tested on:
Linux, Windows