Skip to content

check for and fix mutable keyword defaults #794

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

Merged

Conversation

murrayrm
Copy link
Member

This PR adds a check for keyword arguments in all functions that are initialized to mutables and fixes a few errors that were found. Setting keyword defaults to mutables is still allowed by listing the function in a table. This should help introduction of errors if a mutable is used as a default keyword in future updates.

@murrayrm murrayrm changed the title check for and fix mutable keyword args check for and fix mutable keyword defaults Nov 19, 2022
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0007%) to 94.8% when pulling 4968cb3 on murrayrm:mutable_default_args-13Nov2022 into 2dc409b on python-control:main.

@roryyorke
Copy link
Contributor

Looks good to me. FWIW pylint has a warning for mutable args.

@bnavigator bnavigator merged commit 2a799e9 into python-control:main Nov 20, 2022
@murrayrm murrayrm added this to the 0.9.3 milestone Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants