lazy arithmetic

Gabriel G gabrielg_laburando at yahoo.com.ar
Fri Aug 25 02:38:57 EDT 2006


At Friday 25/8/2006 02:18, pianomaestro at gmail.com wrote:

> > x+y get translated to x.__add__(y)
>
>No that's not true at all. The self argument to __add__ ends
>up being the Add instance, not the Item instance:
>
>z=x+y  is translated to z.__add__(y)

Well, I deleted my response after I noticed that Simon Forman has 
done it very well.
Just a note: print z after this line and compare with self inside 
__init__ if you're still not convinced.



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