At 01:16 PM 3/29/04 +1000, Dave Harrison wrote: > > If we were designing Python 3.0 here, I would probably suggest the > > following syntax for classmethods: > > > > def foo(class cls, x, y): > > ... > > > > and wouldn't bother with staticmethods at all. How often do you > > actually need a staticmethod in particular and *not* a classmethod? > >It's quite useful to be able to develop, essentially stateless, static >method utility libraries that dont need to be class based. Why create >an object if you simply don't need one ? Just define a function, then. All staticmethod does is let you put a function in a class and have it remain a function instead of a method. >If this was an option, there would have to be a way to use it without >the class element, There is: just define a function. No staticmethod required.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4