james_027 a écrit : > 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
Marc's example is typically an alternate constructor. This is indeed one of the most obvious use case of classmethod, but what I meant is that there are others cases where classmethods can help. -- http://mail.python.org/mailman/listinfo/python-list