Message75850
I believe I found an unintentional syntax error with a combination of
decorators, parenthesis, and dots. Here's a demonstration:
class C:
def prop(self, function):
return property(function)
class F:
@C().prop
def foo(self):
return 5
Which errors out with:
File "foo.py", line 6
@C().prop
^
SyntaxError: invalid syntax
I can't imagine why this would be desired, since these equivalent forms
work:
class D:
def foo(self):
return 5
foo = C().prop(foo)
class E:
c = C()
@c.prop
def foo(self):
return 5 |
|
Date |
User |
Action |
Args |
2008-11-14 06:03:31 | erickt | set | recipients:
+ erickt |
2008-11-14 06:03:31 | erickt | set | messageid: <1226642611.77.0.508088542922.issue4321@psf.upfronthosting.co.za> |
2008-11-14 06:03:30 | erickt | link | issue4321 messages |
2008-11-14 06:03:29 | erickt | create | |
|