[issue2516] Instance methods are misreporting the number of arguments
Alexander Belopolsky
report at bugs.python.org
Mon Mar 31 00:23:35 CEST 2008
New submission from Alexander Belopolsky <belopolsky at users.sourceforge.net>:
Opening a new issue per Raymond's request at msg64764:
"""
It would be *much* more useful to direct effort improving the mis-
reporting of the number of arguments given versus those required for
instance methods:
>>> a.f(1, 2)
TypeError: f() takes exactly 1 argument (3 given)
"""
I would suggest that this misreporting may be dear to old-beards
reminding the time when there was not as much difference between methods
and functions as there is now.
It does not seem to be that hard to change the diagnostic to
>>> a.f(1, 2)
TypeError: f() takes no arguments (2 given)
but the novice users would much rather see "a.f() takes no arguments (2
given)." The later is unfortunately not possible.
Raymond, what would you say to "<class 'A' instance>.f() takes no
arguments (2 given)" diagnostic?
----------
components: Interpreter Core
messages: 64767
nosy: belopolsky, rhettinger
severity: normal
status: open
title: Instance methods are misreporting the number of arguments
type: behavior
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2516>
__________________________________
More information about the Python-bugs-list
mailing list