#728: Investigate PEAK's [] syntax for decorators under 2.3
-------------------------+--------------------------------------------------
 Reporter:  kevin        |        Owner:  simon   
     Type:  enhancement  |       Status:  assigned
 Priority:  normal       |    Milestone:  0.9     
Component:  TurboGears   |      Version:  0.9a4   
 Severity:  normal       |   Resolution:          
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by simon):

 Some good news and some bad news. The good news is, it can be done pretty
 trivially, the bad news is, trivial is cumbersome as it involves passing
 return value from the decorator through yet another function:
 {{{
 def foo(baz, bar):
   def entangle(func):
     def foo(func, *arg, **kw):
       return func(*arg, **kw)
     return decorator(foo)(func)
   return legacy_decorator(entangle)
 }}}
 Ideally this functionality should be seamlessly bundled with decorator().
 I see two obvious ways of doing so:

 1) dirty hack/magic -- we constrain inner and outer decorator functions to
 have the same name.

 2) change the logic behind decorator() -- breaks backward compatibility.

 My vote goes to 2).

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/728>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to