How does "delegation" work as per the FAQ?

Jeff Epler jepler at unpythonic.net
Thu Dec 25 15:20:57 EST 2003


In Python, there's little difference between
	f = o.m
	f(3)
and
	o.m(3)
either way, the attribute 'm' is looked up on o in exactly the same
way.  So the delegation pattern works no matter whether 'o.m' is a
method or is data.

Jeff





More information about the Python-list mailing list