Empty Class constructor : Class Constructor « Class « Python






Empty Class constructor

class C(object):
    def __init__(self, parameter): pass

x = C.__new__(C, 23)

if isinstance(x, C): 
     C.__init__(x, 23)

           
       








Related examples in the same category

1.Constructors DemoConstructors Demo
2.A class may define a special method named __init__()A class may define a special method named __init__()
3.A very simple class with a constructor.A very simple class with a constructor.
4.A Simple Logger ClassA Simple Logger Class