Skip to content
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

Use of mutable default arguments throughout project #309

Closed
Qinusty opened this issue Apr 15, 2019 · 1 comment · May be fixed by #302
Closed

Use of mutable default arguments throughout project #309

Qinusty opened this issue Apr 15, 2019 · 1 comment · May be fixed by #302
Labels

Comments

@Qinusty
Copy link

Qinusty commented Apr 15, 2019

The use of mutable values for default arguments is well documented to cause problems.

Anything following this format

# Function with mutable argument as default
def func(self, var=[]):

Should be adapted to the following.

# Should become
def func(self, var=None):
    if var is None:
        var = []

Other examples of default mutable arguments throughout the project are empty dicts.

@stale
Copy link

stale bot commented Jul 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 14, 2019
@stale stale bot closed this as completed Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant