classmethod & staticmethod

james_027 cai.haibin at gmail.com
Tue Jul 24 06:44:50 EDT 2007


hi,

> The 'real' use is (are) the one(s) you'll find. FWIW, I use
> staticmethods for helper functions that don't need access to the class
> or instance but are too specific to a class to be of any use as plain
> functions. Which is not a very frequent case. Classmethods are more
> usefull - mostly as alternate constructors or utility methods for an
> alternate constructor, but there are other possible uses (sorry, I have
> no concrete example at hand).

You mean like the example from Marc

Thanks
james




More information about the Python-list mailing list