[Python-Dev] method decorators (PEP 318)

Dave Harrison dave at nullcube.com
Sun Mar 28 22:16:52 EST 2004


> 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 ?

If this was an option, there would have to be a way to use it without
the class element, or at least with there being a keyword to use which
allowed the class element to be ignored.

-- 
Dave Harrison
Nullcube
dave at nullcube.com
http://www.nullcube.com



More information about the Python-Dev mailing list