[New-bugs-announce] [issue18474] Lambda assigned to object does not automatically get self

James Lu report at bugs.python.org
Tue Jul 16 16:20:54 CEST 2013


New submission from James Lu:

if you assign a lambda to a object and call it,you get this:
Traceback (most recent call last):
  File "<pyshell#21>", line 1, in <module>
    n.__div__(3)
TypeError: <lambda>() takes exactly 2 arguments (1 given)
The full test is here:
>>> n = num()
>>> n.__div__
<function <lambda> at 0x040B2DF0>
>>> n/3
Traceback (most recent call last):
  File "<pyshell#20>", line 1, in <module>
    n/3
TypeError: unsupported operand type(s) for /: 'num' and 'int'
>>> n.__div__(3)
Traceback (most recent call last):
  File "<pyshell#21>", line 1, in <module>
    n.__div__(3)
TypeError: <lambda>() takes exactly 2 arguments (1 given)

----------
messages: 193166
nosy: James.Lu
priority: normal
severity: normal
status: open
title: Lambda assigned to object does not automatically get self

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


More information about the New-bugs-announce mailing list