is python Object oriented??

Michael Torrie torriem at gmail.com
Sat Jan 31 17:16:52 EST 2009


Steve Holden wrote:
> You can think what you like, but there is a fundamental difference
> between methods of a class and functions of a module. Until you
> appreciate that you will likely make mistakes. Don't worry, though, we
> all learn from our mistakes.

And this fundamental difference is?

>From what I can tell an instance method is an object that encapsulates
the function object in a closure that makes sure it has a reference to
"self."  I know that you dynamically add functions to objects creating
methods dynamically, by using new.instancemethod or something.

This seems to indicate to me that there are functions and there are
functions.  Methods are in fact functions, just with a callable wrapper
around them.  Is this not so?



More information about the Python-list mailing list