aleaxit at yahoo.com
Sun Mar 25 18:50:49 CEST 2001
"Rick Lee" <rwklee at home.com> wrote in message
news:3ABD7673.9D447A32 at home.com...
> Thanks, and thanks to Alex. This is very useful, also very telling that
> is pretty obscure. For me, static, or class-wide methods are very useful.
> With this, you only have to pass the class reference to the caller.
> Otherwise, you have to pass both the class reference and the module
> reference to the caller.
Actually, the module reference will suffice; it will contain suitably
named callables to:
-- generate instances of the class (the class-object itself and/or
suitable factory functions),
-- do whatever else you need to be done class-wise.
You can package up those callables any way you want; there is
really no special reason they should be attributes of the class
object as opposed to that of any other object, and a module
object is typically handiest.
The desire to use the class-object specifically, rather than any
other, typically seems to have more to do with familiarity with
other languages where classes must play certain special roles
(C++, Java, Smalltalk, Eiffel) than with any actual programming
More information about the Python-list