#2429: paginate() breaks when calling a method with multiple keyword arguments
------------------------+---------------------------------------------------
 Reporter:  pitrou      |        Owner:  percious
     Type:  defect      |       Status:  new     
 Priority:  normal      |    Milestone:  2.1b1   
Component:  TurboGears  |      Version:  2.0.3   
 Severity:  normal      |   Resolution:          
 Keywords:              |  
------------------------+---------------------------------------------------
Comment (by pitrou):

 Well, `argspec..[:1]` is fine: it removes the `self` from the method
 signature, shifting the remaining method parameters to the left:

 {{{
 >>> def f(self, x, y, z=1):
 ...   pass
 ...
 >>> inspect.getargspec(f)[0][1:]
 ['x', 'y', 'z']
 }}}

 However, similar left-shifting must be accomplished on the actual
 arguments when mapping them to the parameters from the method signature,
 which is what the patch does: when calling `f(*args, **kwargs)`, `args[0]`
 has to contain the `self` object for the method, i.e. the controller
 instance. Without the patch, `args[0]` can be overwritten with the value
 of the first non-self argument (`x` in the example above).

 If I look at http://bitbucket.org/turbogears/tg-
 dev/src/tip/tg/decorators.py (is it the right repo?), the logic is totally
 different in 2.1 so the bug probably only applies to 2.0.

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2429#comment:3>
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.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en

Reply via email to