[Python-Dev] Class Methods

Guido van Rossum guido at digicool.com
Fri Apr 20 12:52:18 EDT 2001


> Look into the motivation for the Prototype Pattern in the GOF
> book, or even better in the discussion of this pattern in the
> 'Design Pattern Smalltalk Companion' book.

I imagine many of us (including yours truly :-) don't recall that in
enough detail and/or don't have the book handy to look it up, so would
you please do us a favor and explain this in a bit more detail?

> This pattern is not needed if classes are 'first class' objects.

Depending on what you mean by the 'first class' phrase (which means
something different to everyone), Python classes are already as first
class as they get.  E.g. they are tangible objects and you can pass
them around and store them in variables.

> What I want to avoid is
> 
>   class X(...):
>       ....
>   initialize(X)

What would initialize(X) do that you can't write in the class body?

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list