PEP 318

Paul Rubin http
Mon Mar 22 02:03:24 EST 2004


Ville Vainio <ville at spammers.com> writes:
> The current foo=staticmethod(foo) makes the Python 'staticmethod' seem
> like a hack. Many users of staticmethod won't even need to know that
> wrapping takes place. It certainly discourages people from using the
> feature in the first place.
> 
> And when did syntactic beauty stop mattering?

"def foo() as staticmethod" certainly looks best to me aesthetically.
The syntax can be extended, i.e. "def foo() as generator" looks to me
to be a lot more explicit than "def foo()" followed by having the
compiler search the function body for a yield statement in order
to decide if it's a generator.



More information about the Python-list mailing list