class objects, method objects, function objects
fredrik at pythonware.com
Mon Mar 19 15:46:55 CET 2007
> But the last part of the passage makes no sense to me:
> When the method object is called with an argument list, it is unpacked
> again, a new argument list is constructed from the instance object and
> the original argument list, and the function object is called with
> this new argument list.
> Can anyone interpret that for me?
when you call obj.method(arg1, arg2), Python prepends the actual instance
object (obj) to the argument list, so you end up calling (obj.method) with the
arguments (obj, arg1, arg2).
More information about the Python-list