[issue2516] Instance methods are misreporting the number of arguments

Alexander Belopolsky report at bugs.python.org
Mon Mar 31 02:37:28 CEST 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

Attached patch (issue2516poc.diff) presents proof-of-concept code which 
changes the problematic reporting as follows:

>>> a.f(1,2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: <A object>.f() takes exactly 0 arguments (2 given)

More effort is needed to make this patch ready: support default/keyword 
arguments, respect English grammar in 1-argument case, etc.  Before I do 
that, however, I would like to hear that this is a worthwhile fix and 
that I've chosen the right place in the code to implement it.

----------
keywords: +patch
Added file: http://bugs.python.org/file9908/issue2516poc.diff

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2516>
__________________________________


More information about the Python-bugs-list mailing list