Message322298
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 |
|
Date |
User |
Action |
Args |
2018-07-24 12:58:46 | xtreak | set | recipients:
+ xtreak, rhettinger, terry.reedy, serhiy.storchaka, ppperry |
2018-07-24 12:58:46 | xtreak | set | messageid: <1532437126.26.0.56676864532.issue34193@psf.upfronthosting.co.za> |
2018-07-24 12:58:46 | xtreak | link | issue34193 messages |
2018-07-24 12:58:46 | xtreak | create | |
|