Skip Montanaro <skip at pobox.com>: > If not, you'll probably get people (newbies > at least) trying to write stuff like this: > > def foo(a): > if a > 5: > @attr: "bob" > elif a > 0: > @attr: "skip" > else: > @attr: "guido" > > The other forms (via a decorator, using explicit attribute assignments after > the definition) make it explicit that these attribute assignments don't > occur in the context of function execution. Hmmm... What about def foo(a): attributes: author = "Guido" deprecated = 1 body: b = sqrt(a) return 3 * b / 2 Would that provide sufficient clues that the attributes are *not* part of the body? Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg at cosc.canterbury.ac.nz +--------------------------------------+
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