Karthikeyan Singaravelan <[email protected]> added the comment:
Thanks, this needs to be fixed only in `check_num_args` and can help in all the
other functions like __lt__, __delattr__ etc. in the file that use this.
Before suggestion :
➜ cpython git:(bpo34193) ✗ ./python -c "a = {}; a.__delattr__()"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: expected 1 arguments, got 0
After suggested change :
➜ cpython git:(bpo34193) ✗ ./python -c "a = {}; a.__delattr__()"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: expected 1 argument, got 0
Is there some doc on clarification of the difference between 'required'
argument and positional argument errors. I was trying to write to tests for the
changes and I couldn't find functions that hit the exact branch of code. Some
of them generate required argument error and some of them generate positional
argument expected error. I looked up in the argument clinic docs
(https://docs.python.org/3/howto/clinic.html) but it's little hard for me to
grasp as a beginner. Any pointers will be helpful.
Thanks
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34193>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com