is python Object oriented??

Chris Rebert clp2 at rebertia.com
Thu Jan 29 22:53:04 EST 2009


On Thu, Jan 29, 2009 at 7:31 PM, Steven D'Aprano
<steven at remove.this.cybersource.com.au> wrote:
> On Thu, 29 Jan 2009 02:25:57 -0800, Chris Rebert wrote:
>
>> In addition to methods, Python has functions, which are not associated
>> with a class
>
> Yes they are.
>
>>>> (lambda: None).__class__
> <type 'function'>
>
> The function type itself has a class:
>
>>>> (lambda: None).__class__.__class__
> <type 'type'>

I think we're now quibbling over the interpretation of "associated".
My intention was to contrast how methods and classmethods are stored
and accessed through the class they are defined in (or grafted onto),
whereas plain functions are not (instance/class variables that happen
to hold functions notwithstanding).

Cheers,
Chris

-- 
Follow the path of the Iguana...
http://rebertia.com



More information about the Python-list mailing list