> >Well, it is worrying me. Each special case is one more thing that adds a >burden to using Python. The fact that whitespace and comments are allowed >between the decorator and function definition is particularly worrying to >me - it can quite easily mask errors in code - particularly newbie errors: > > [a] # oops - I copied this from an interactive session and forgot to > modify it. > > # This is a simple function > def func (args): > pass I'm not invested into this in any way, but the variations +[classmethod] def f(cls): pass or -[classmethod] def f(cls): pass are syntactically valid today but OTOH differently from plain [...] correspond to run-time errors. /[classmethod] def f(cls): pass *[classmethod] def f(cls): pass even better are syntax errors but are really ugly. I could live with the +[...] form, as I can live [...] def f(...): or def f(...) [...]: it's really a matter of "practicality beats purity" and a compromise/balance issue. The limits of the parser aren't helping either in this case.
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