Phillip J. Eby: > 'as' is not currently a keyword, and making it so would break > any programs that use it as a name. It has been documented as a pseudo-keyword for some time, with the warning that it will may become a real keyword later. > Really, of the current "before the def" proposals, I think I > like Samuele's: *[classmethod] def func(*args): pass approach the best. The '*' seems to say "special note, pay attention". :) I agree that it says special note; it just doesn't say *why* the list is special. We happen to know that it secretly means "After you evaluate this list, keep a reference, then call each member on the function or class I'm about to define." but a keyword (even as) makes it more explicit why this list is special. Of course, as: d1, d2, d2 def func(args): pass also works; if you put a keyword at the front, then [] becomes redundant. And that was one of the bakeoff options, except that Guido used "decorate:" instead of "as:" in his example. -jJ
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