On Wed, 2004-02-25 at 22:37, Skip Montanaro wrote: > I'll add another data point. Quixote'd PTL uses almost this exact syntax to > distinguish between PTL functions/methods which return HTML or plain text. > The only difference is that it places the annotation before the argument > list: > > def head [html] (title): I think the reason why this (and the proposed method annotation syntax) is readable is that it reads as a parenthetical note [i.e. something that is intended to convey a bit of extra information]. It would be interesting to show def foo(self) [classmethod]: to a relative python beginner and ask them the guess at the meaning. My hunch is that they would assume that "[classmethod]" modifies the meaning of the function defintion in some way. The curious could then look up classmethod in the manual, where they would presumably find a note about the [] syntax. Mark Russell
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