PEP 318

Jacek Generowicz jacek.generowicz at cern.ch
Mon Mar 22 11:11:26 CET 2004


Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:

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

Most importantly, the current style separates the unambiguous
information that the method is a static or class method from the "def"
which starts the method's definition, by far too much.

> "def foo() as staticmethod" certainly looks best to me aesthetically.

My only slight reservation is the increased "keyword overloading". For
example ... "static" has something like 7 distinct meanings in C++ (at
last count), and I find that this has a detremental effect on
discussions with colleagues. I hope that Python will be able to avoid
such problems.



More information about the Python-list mailing list