- There is no universally liked syntax (or even a universally _tolerable_ syntax) - decorators will incosistently retain or drop docstrings (this may even be the most appropriate thing to do) - a "decorated" function may have an arbitrarily distant relationship with the function as implemented in the def statement (this is a killer) - if you want to decorate a single function two separate ways, you're back to 2.3 syntax - say, one that logs, checks parameters, etc., and the "internal" optimal version. None of the decorator syntaxes facilitate this. Because of all these issues, I think we should drop PEP 318. The 2.3 form seems more reasonable all the time: def __func( self ): pass spanishInquisition = mydecorator( __func ) spanishInquisition.__doc__= """Something unexpected""" parrot = otherdecorator( __func ) parrot.__doc__ = """And now for something completely different""" Are any of the syntaxes enough better to justify the irritation or divisiveness of including it? Syntactic sugar causes cancer of the semicolon, indeed... kb
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