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

Avoid mutable types as default args. #373

Merged
merged 1 commit into from
Dec 1, 2021

Commits on Nov 25, 2021

  1. Avoid mutable types as default args.

    This change removes two places where we use a set as a default value.
    Mutable containers should not be used as default arguments as they are
    created when the function is defined (basically, the first time the
    module is imported) and then that one instance is used anytime the
    method is invoked without that argument specified.  This means that
    changes to the container will persist to the next time the function is
    invoked which could lead to bugs down the road.
    
    I do not believe we're currently experiencing any bugs due to this as we
    never seem to mutate the containers.  Instead, we use the data to make
    new sets inside of the functions.
    abadger committed Nov 25, 2021
    Configuration menu
    Copy the full SHA
    2e796b0 View commit details
    Browse the repository at this point in the history