Understanding def foo(*args)

Ulrich Eckhardt doomster at knuut.de
Sun Jan 30 15:21:28 EST 2011


sl33k_ wrote:
> Isnt it like self must be the first parameter to the method/function?

"self" is just customary as first parameter to memberfunctions, the 
language itself doesn't impose this convention, as e.g. C++ does with its 
"this".


> Also, can the terms method and function be used interchangeably?

This distinction doesn't exist in Python. You can put a reference to a 
"free" function as attribute in an object. You can store a reference to a 
"bound" memberfunction outside the object and call it.

Objects and classes here are much more flexible than in C++ or Java.

Uli




More information about the Python-list mailing list