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