Sujet : Re: Using __new__
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 17. Feb 2024, 23:51:29
Autres entêtes
Organisation : Stefan Ram
Message-ID : <new-20240217234535@ram.dialup.fu-berlin.de>
References : 1
Jonathan Gossage <
jgossage@gmail.com> writes:
I am attempting to use the __new__ method in the following code:
class SingletonExample(object):
Above, you specify that the superclass is "object".
super().__new__(cls, **kwargs)
Now, since you know the superclass to be "object",
why can't you just write "super().__new__( cls )"?