Personally, I believe discussion over PEP 318 has wandered from an implementation and practical purity, into a syntactical nightmare. We went from a single decorator syntax that worked for all kinds of decorators, to another decorator syntax...that still works for all kinds of decorators. Wait, decorators haven't changed...but something else has. In addition to the proposed decorator syntax, now there is this other syntax that seems to want to be attached to 318 (that Guido seems to want to use '@', others have suggested '.' and ':' to signify), for inserting metadata attributes into the function body. This syntax doesn't allow if, while, etc. statements, and really could be considered a subset of Python. I just read Mike Rovner's idea of allowing a dictionary in the body, just before or after the docstring, to update the function's __dict__ attribute. If there existed an in-body metadata syntax, the dict literal fits the current docstring syntax. PEP 318 is about general function and class decorator syntax, which most everyone has basically agreed upon (some list just before or after the arguments), and this metadata-specific extension, I believe should be its own PEP (regardless of which idea is favored, and regardless of whether it is a good idea). - Josiah P.S. If dict literals are the future syntax of metadata, should functions get implicit __slots__ with a list literal, ignoring all metadata updates with unlisted slots? <wink>
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