I'm searching a way to create instances of an classe without using the __init__
by only getting an empty instance of the classe without attribute or with empty (None) attributes.
The general idea is :
class InstanciableEmpty:
def createEmptyInstance(self):
class_to_instanciate = self.__class__
#DO something
return newEmptyInstance
class AnyOtherClass(InstanciableEmpty):
def __init__(self):
self.attr = 1
class AnyOtherClass2(InstanciableEmpty):
def __init__(self, attr):
self.attr = attr
The idea behind that is to create an generic classe wich can create copi of any sort of object without anything to write in the class who as herited from the generic classe.