Method / Functions - What are the differences?

Rob Williscroft rtw at rtw.me.uk
Sun Feb 28 15:24:06 CET 2010


Michael Rudolf wrote in news:hmdo3m$287$1 at news.urz.uni-heidelberg.de in 
comp.lang.python:

> Note that all I did was moving the list and foo into the instance. Still 
> no self and no cls, but also no static behaviour any more.

Yes in the first case foo was an attribute of the class, and in the second
an attribute of aon instance of the class.

In both cases it was a bound method, something similar too:

  lambda item : T.x.append( item )




More information about the Python-list mailing list