On Jun 14, 2006, at 3:24 PM, Javier Rojas wrote:

>
> 2006/6/14, Kevin Dangoor <[EMAIL PROTECTED]>:
>>
>> On Jun 14, 2006, at 11:38 AM, Javier Rojas wrote:
>>
>>
>> This is what I'd expect. In the second case, you're referring to the
>> name "add" before it has been created.
>
> err.. sort of. I expect it to work like if I had two methods, and I
> call the second from the first. It works, despite of the second method
> being defined after the first one

The difference is scope, though. Decorators are all defined in the  
context of the class, not in the context of the method. Consider this  
case:

class Foo(object):
     bar = property(bar)

     def bar(self):
         return "BAR"

This will fail for exactly the same reason. "bar" hasn't been defined  
yet in the class.

If there's an actual use case that's not being met, we'll certainly  
try to deal with that...

Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to