On Monday 2004-03-08 18:48, Phillip J. Eby wrote: > Anyway, I seem to recall that the bracketed syntax was originally inspired > by C#'s attribute mechanism, but you'd have to ask the original author to > be sure. I think I was the first to propose the bracketed syntax (in <slrna40k88.2h9o.Gareth.McCaughan at g.local>, after Tim Peters pointed out a problem with a different syntax I'd proposed for the same purpose in <slrna3va8t.2a7p.Gareth.McCaughan at g.local>. The proposal certainly wasn't in the least inspired by C#'s attribute mechanism; I'd never even seen it then. For what it's worth, I still have a strong preference for the original "def f(args) [decorators]:" syntax, despite Guido's preference for "def f [decorators] (args):". The problem Tim pointed out was that the first-proposed syntax def staticmethod f(args): ... would confuse over-simple ad hoc parsers (in text editors, code munging tools, etc.) into thinking that the above was defining a function or method called "staticmethod". A similar, but (much?) less severe, problem may attend the syntax that just moves the decorator-spec to before the argument list. I suspect this isn't serious enough to count as a real objection. -- g
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