
Aug. 3, 2004
11:06 a.m.
On Tue, 2004-08-03 at 05:17, James Y Knight wrote:
Things someone might want to do, ordered roughly from most reasonable to least reasonable ;) @foo().bar() @foo or bar @mydecorators['foo'] @lambda f: foo(f) or bar(f)
Why disallow these forms? It seems quite difficult, especially, to explain why the first one does not, or should not, work.
I don't think any of these seem that likely in practice, and if you do want them, it is not hard to say: # Hopefully some comment here explaining the reason why you're # doing this. And a more meaningful name than foo_or_bar! foo_or_bar = foo or bar @foo_or_bar def func(): pass I would say leave it like this for now. It is easy to relax the restriction later if there's a demand. Mark