Jeremy Hylton wrote: > Another possibility that has been suggested is > [decorator] > def func(arg, arg): The decorator before def spelling is familiar from C#, and looks the nicest to me. However, I'm curious about the way decorators differ from docstrings to explain putting one kind of metadata shorthand before def and the other after. [decorator] def func(arg, arg): """Docstring""" pass def func(arg, arg): [decorator] """Docstring""" pass If there will only ever be two of these kinds of things, and a consensus is to put them on lines before and after the def, that would seem to be reason enough for decorator before def. If someday there were other types of metadata distinct from decorators, perhaps immutable and pertaining to secure execution, the before-docstring spelling might allow for more consistent additions to the shorthand. def func(arg, arg): [decorator] (otherator) """Docstring""" pass
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