[pyar] Ejecutar un método al finalizar la instanciación

Juan BC jbc.develop en gmail.com
Lun Jul 12 16:05:24 ART 2010


lo resolvi asi

class A(object):

	@classmethod
	def __new__(cls, *args, **kwargs):
		instance = super(A, cls).__new__(cls, *args, **kwargs)
		instance.metodo()
		return instance
	
	def metodo(self):
		pass

y eso funciono



More information about the pyar mailing list