PEP 318

Skip Montanaro skip at pobox.com
Sun Mar 21 12:16:32 EST 2004



    Marco> def foo(x, y)[staticmethode]: pass
    ... vs ...
    Marco> def foo(x, y) as staticmethode: pass

    Marco> Define foo with arguments x and y as staticmethode.

    Marco> Is Python now C++? Mabe I miss something why this syntax is wrong.

I believe the "as wrap1, wrap2, ..." form is one of the alternatives under
consideration, though current sentiment seems to be in favor of the
list-like syntax.

Python has a long history of borrowing good ideas from other languages.  I'm
not aware that any of this is being borrowed from C++, no matter that it has
some syntactic similarities to stuff C++ does.  Note in particular that the
construct is much more general than applying the currently available
staticmethod and classmethod builtins.  The end result need not even be a
function or class (there has been some discussion about applying this
construct to classes, but it's not as obviously valuable).  See recent
discussion in the python-dev archives for some other ideas.

Skip






More information about the Python-list mailing list