-
Notifications
You must be signed in to change notification settings - Fork 11
Bug: Do not **unintentionally** modify function arguments #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Agreed. Needs to be addressed! Should not be too complicated to fix, but a bit hard to spot. Is there a static code analyzer that does check for it? |
i don't know… we should definitely (also?) consider using MyPy. |
a non-None default causes the parameters to be pass-by-reference, and hence mutable! We don't generally want that. This fixes bsdci#38
a non-None default causes the parameters to be pass-by-reference, and hence mutable! We don't generally want that. This partially(??) addresses bsdci#38
a non-None default causes the parameters to be pass-by-reference, and hence mutable! We don't generally want that. This partially(??) addresses #38
after installing
|
install flake8-mutable (and, just to be sure, flake8-builtins;) to check for these things, as reported in #38.
install flake8-mutable (and, just to be sure, flake8-builtins;) to check for these things, as reported in #38.
install flake8-mutable (and, just to be sure, flake8-builtins;) to check for these things, as reported in #38.
install flake8-mutable (and, just to be sure, flake8-builtins;) to check for these things, as reported in #38.
We have a handful of functions that take non-
None
arguments, and then modify them.This leads to python directly modifying the passed argument, and is generally considered bad form.
One such example is
JailConfigAddresses#add()
maybe there are linter params that will warn us of such code, until then we might need human eyes.
The text was updated successfully, but these errors were encountered: