How to instantiate a different class in a constructor?

Gabriel Genellina gagsl-py at yahoo.com.ar
Tue Jan 23 18:57:06 EST 2007


At Tuesday 23/1/2007 20:07, GiBo wrote:

>BTW When is the subclass.__init__() method invoked if I don't explicitly
>call it from __new__()? Apparently not from baseclass.__new__() nor from
>object.__new__().

At instance creation, when type(name, bases, ns) is invoked, after 
the __new__ call, but only if the returned object is an instance of 
type. This happens in function type_call (in typeobject.c)


-- 
Gabriel Genellina
Softlab SRL 


	

	
		
__________________________________________________ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 




More information about the Python-list mailing list