Inconsistent behavior regarding invalid kwarg names during Actor initialization
- Dominant language
- Python
- Stars
- 611
- Forks
- 211
- PR merge metrics
- No merged PRs in 30d
Description
During an `Actor`'s initialization only a small portion of invalid keyword argument names (kwargs) are detected by the spellchecker. If the spellchecker does not find a match, then the invalid name is ignored.
Expected result:
Invalid kwarg names used during an `Actor`'s initialization should be detected and the user notified. If no spelling suggestion is available the user should still be informed of the error. The reason behind this extra checking (and notification) is to help beginner programmers debug their code.
Actual result:
Many invalid kwarg names used during an `Actor`'s initialization appear to be accepted.
This code and following error show that when the spellchecker finds a match the user is informed of the invalid kwarg name.
```
alien = Actor('alien', toplef=(0,0))
```
```
TypeError: Unexpected keyword argument 'toplef' (did you mean 'topleft'?)
```
This code, however, gives no error even though all the kwarg names are invalid.
```
alien = Actor('alien', x=0, y=1, no_error=2, top=3, bottom=4, mid=5)
```
System details:
- os: windows 10 (64bit)
- python: 3.7.2 (64bit)
- pygame: 1.9.4
- pgzero: 1.2 (also master branch at ef963beaa22db89cb011695e96587bb268cbec2a)
- numpy: 1.15.4
Related to #141.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating Actor initialization and the spellchecker path, then reproduce both keyword examples from the issue. Check that every invalid keyword raises an error, including names with no spelling suggestion, while valid keywords remain accepted; add or update coverage if the relevant tests are found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100