Re: Using __new__

Liste des GroupesRevenir à cl python 
Sujet : Re: Using __new__
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 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 )"?

Date Sujet#  Auteur
17 Feb 24 o Re: Using __new__1Stefan Ram

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal