On Fri, 13 Aug 2004 19:06:13 +0100 Gareth McCaughan <gmccaughan at synaptics-uk.com> wrote: > def p_statement_expr(self, p): > """docstring goes here""" > print p[1] > decorated: > staticmethod > grammarrule('statement : expression') > version("Added in 2.4") > deprecatedmethod > type_(None) > > which keeps the arguments with the function name, > keeps the body right after the name and arguments, and > puts the decoration after the body which corresponds > with the order in which things actually happen (though > not necessarily the best order for understanding the > code). You seem to have missed the point of function decorations entirely. We already have what you offer in current Python syntax. The point was to move decorations to near/next to the function signature. Read the PEP: http://www.python.org/peps/pep-0318.html > I actually quite like this. It seems more Pythonic > than the @foo proposal. Its obvious problem is that > it involves something that looks at first glance like > an ordinary suite of statements or expressions, but > whose interpretation is substantially different. At > least the @foo proposal avoids that. What you like is what has existed with Python since the beginning. - Josiah
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