[Python-Dev] Error message for wrong number of arguments

Chris Barker chris.barker at noaa.gov
Mon Jul 30 16:19:06 EDT 2018


On Mon, Jul 30, 2018 at 11:39 AM, Jeroen Demeyer <J.Demeyer at ugent.be> wrote:

> On 2018-07-30 20:22, Chris Barker wrote:
>
>> is it possible for the interpreter to know when this error is
>> generated that this is a bound method expecting a "self", rather than an
>> arbitrary function with n parameters?
>>
>
> That would be quite hard. The error message is generated by the underlying
> function. At that point, the information of how it was called (as bound
> method or not) is already gone.


Thanks, I figured as much.

Oh well. This is a serious usability issue -- but what can you do?

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180730/58074adb/attachment.html>


More information about the Python-Dev mailing list