> Because '[foo]' is absolutely a list with no side effects in today's > Python. But '[foo()]' clearly *can* have some side effect, so if > you're reading the code you have to look up 'foo' to understand > what's happening there. Too subtle for the folks who argued against [foo] on grounds of ambiguity I think. > This isn't at all sudden, btw: David Abrahams made the first > 'decorate' proposal in June, and suggested the idea of using the > debugger hook to implement it. I thought that one of the best parts > of David Abrahams' idea was that requiring a function call made the > [] syntax less ambiguous. And I think it is one of the worst. sys.settrace is an implementation feature not a language feature. > Well, the other point is that it allows you to use C# syntax. Note > that if it were spelled: > > [classmethod()] > def foo(x): > ... > > this would also resolve the ambiguity (IMO). Not IMO, that would just add more mystery (and would require yet another hack in classmethod to allow it to be called without args). --Guido van Rossum (home page: http://www.python.org/~guido/)
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