A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/043637.html below:

[Python-Dev] method decorators (PEP 318)

[Python-Dev] method decorators (PEP 318)Greg Ewing greg at cosc.canterbury.ac.nz
Mon Mar 29 01:26:13 EST 2004
Josiah Carlson <jcarlson at uci.edu>:

> > I'm not sure I understand. Why not make them module-level functions?
> 
> Namespaces my friend, namespaces (I don't know if other people use this,
> but I have on occasion).

My point was, that in any likely use I can think of for
staticmethods, it wouldn't do any *harm* to use a classmethod
instead.

> def make_all_static(cls):
>     for i,j in cls.__dict__.iteritems():
>         if isinstance(j, instancemethod)
>         cls.__dict__[i] = staticmethod(j)

You'd still be able to do that, just as you'd still be able
to use the old method of creating a staticmethod. There
just wouldn't be any special syntax just for staticmethods
analogous to the one I suggested for classmethods.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list

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