New submission from Alexander Belopolsky <[EMAIL PROTECTED]>: 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 <[EMAIL PROTECTED]> <http://bugs.python.org/issue2516> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com