A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-May/100233.html below:

[Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method

[Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a methodGreg Ewing greg.ewing at canterbury.ac.nz
Fri May 21 03:23:15 CEST 2010
Floris Bruynooghe wrote:

> Not having looked at the code I don't know how hard it is for the code
> that raises this traceback to notice if it's a bound or unbound method
> tough.

The way things currently work, it would be quite difficult.
The exception is raised when attempting to call the function
underlying the bound method, at which point it can't be
distinguished from any other way of calling it.

However, it could be made to raise a special subclass of
TypeError that the bound method wrapper could catch and
replace with its own exception.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4