[issue4331] Can't use _functools.partial() created function as method

Jack Diederich report at bugs.python.org
Mon Feb 22 17:33:53 CET 2010


Jack Diederich <jackdied at gmail.com> added the comment:

I'm having some trouble wrapping my head around this one.  It isn't obvious to me that
my_method(*args):
  print(args)
class A():
  meth = partial(my_method, 'argA')
ob = A()
ob.meth('argB')

should print (<A object at 0x1234>, 'argA', 'argB') and not
('argA', <A object at 0x1234>, 'argB')

The patch seems to prefer the first form but if you are using a partial shouldn't you expect 'argA' to always be the first argument to the partial-ized function?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4331>
_______________________________________


More information about the Python-bugs-list mailing list