Consider this code snippet:
Errors reported are:
- In CPython:
TypeError: f() got an unexpected keyword argument 'y'
- In uPy:
TypeError: function does not take keyword arguments
I hit this when calling a user-defined function and was very confused because all user-defined functions accept keyword arguments (only built-in ones may not accept kw args). IMO the error message should at least be changed to be less confusing, but if we can spare bytes it should report which particular kw arg is causing the problem (and that's quite a simple change since at that point in the code it is known what the kw is that couldn't be found).
Consider this code snippet:
Errors reported are:
TypeError: f() got an unexpected keyword argument 'y'TypeError: function does not take keyword argumentsI hit this when calling a user-defined function and was very confused because all user-defined functions accept keyword arguments (only built-in ones may not accept kw args). IMO the error message should at least be changed to be less confusing, but if we can spare bytes it should report which particular kw arg is causing the problem (and that's quite a simple change since at that point in the code it is known what the kw is that couldn't be found).