static methods

Paul Prescod paulp at ActiveState.com
Fri Mar 23 23:27:42 CET 2001


"Clark C. Evans" wrote:
> 
> I was wondering if there is any rationale as to why
> Python classes do not have static methods?

Probably because they are simply not neccessary. 

def _static():
	XXX.foo=bar
	return XXX.foo

class Class:
	staticmethod = _static
	...

I might like a nicer syntax but I also like the fact that Python is
syntactically small...

-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.activestate.com/pythoncookbook




More information about the Python-list mailing list