difference between class methods and instance methods

Diez B. Roggisch deetsNOSPAM at web.de
Thu Feb 17 11:20:17 EST 2005


John wrote:
> ... hmm... bound methods get created each time you make
> a call to an instance method via an instance of the given class?

No, they get created when you create an actual instance of an object. So
only at construction time. Creating them means taking the unbound method
and binding the created object as first argument to the method. Thus each
instance of a class Foo with a method bar has its own instance of bar - the
bound method bar. But only one per object. 


-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list