Skip to content

Fix mutable default arguments #860

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

lachmanfrantisek
Copy link
Contributor

Using mutable default arguments (e.g. {} or []) will produce shared instances. More info e.g. here.

  • Remove empty list default arguments.
  • Remove empty dict default arguments.

Signed-off-by: Frantisek Lachman <flachman@redhat.com>
Signed-off-by: Frantisek Lachman <flachman@redhat.com>
@lachmanfrantisek lachmanfrantisek force-pushed the fix-mutable-default-arguments branch from 26c8dd4 to 6e204ce Compare August 14, 2019 08:04
@max-wittig
Copy link
Member

Thanks for the contribution!

@max-wittig max-wittig merged commit e8a3585 into python-gitlab:master Aug 14, 2019
@lachmanfrantisek lachmanfrantisek deleted the fix-mutable-default-arguments branch August 14, 2019 09:20
@lachmanfrantisek
Copy link
Contributor Author

Thanks for the contribution!

You are welcome.

Thanks for this project!

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.

2 participants