static python classes ?
Bruno Desthuilliers
bruno.42.desthuilliers at wtf.websiteburo.oops.com
Wed Jun 20 03:24:09 EDT 2007
Tom Gur a écrit :
>> Look for @staticmethod inhttp://docs.python.org/lib/built-in-funcs.html
>>
>> Example:
>> class C:
>> @staticmethod
>> def f(arg1, arg2, ...): ...
>
>
> Oops, sorry for the confusion - I've actually meant a static method,
> and Gerald's answer works fine.
FWIW, staticmethods in Python are of very restricted use - we have
modules and functions for this. And you may be interested in
classmethods (methods that takes the class object instead of the
instance as first argument).
As a last word : trying to write Java in Python wis certainly not the
best option. Better to learn to write Python.
http://dirtsimple.org/2004/12/python-is-not-java.html
More information about the Python-list
mailing list