[Python-Dev] Making staticmethod objects callable?
Nicolas Fleury
nidoizo at yahoo.com
Thu Mar 16 06:10:57 CET 2006
More information about the Python-Dev mailing list
Thu Mar 16 06:10:57 CET 2006
- Previous message: [Python-Dev] Making staticmethod objects callable?
- Next message: [Python-Dev] Making staticmethod objects callable?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Armin Rigo wrote: > Hi Nicolas, > > On Thu, Mar 02, 2006 at 01:55:03AM -0500, Nicolas Fleury wrote: >> (...) A use case is not hard to >> imagine, especially a private static method called only to build a class >> attribute. > > Uh. I do this all the time, and the answer is simply: don't make that a > staticmethod. Staticmethods are for the rare case where you need > dynamic class-based dispatch but don't have an instance around. I think we all agree on this list that there's no point using a staticmethod for that use case. My suggestion was for some comp.lang.python people, a lot coming from other languages. Their reflex would be much more to define a staticmethod. This issue has been pointed a lot of times on comp.lang.python. Regards, Nicolas
- Previous message: [Python-Dev] Making staticmethod objects callable?
- Next message: [Python-Dev] Making staticmethod objects callable?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list