Is there a way to circumvent the constructor __init__ of a class in python?
Example:
class A(object):
def __init__(self):
Taking your question literally I would use meta classes :
class MetaSkipInit(type):
def __call__(cls):
return cls.__new__(cls)
class B(object):
__metaclass__ = MetaSkipInit
def __init__(self):
print "FAILURE"
def Print(self):
print "YEHAA"
b = B()
b.Print()
This can be useful e.g. for copying constructors without polluting the parameter list. But to do this properly would be more work and care than my proposed hack.