Skip to content

Do not use mutable default arguments #626

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

Conversation

marlamb
Copy link

@marlamb marlamb commented Jul 9, 2024

Using mutable default arguments is a common Python problem, see e.g. https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments

In this specific case the default argument even tries to setup some infrastructure settings at import time, which can potentially fail.

Using mutable default arguments is a common Python problem, see e.g.
https://docs.python-guide.org/writing/gotchas/@mutable-default-arguments

In this specific case the default argument even tries to setup some
infrastructure settings at import time, which can potentially fail.
@marlamb
Copy link
Author

marlamb commented Jul 9, 2024

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@baywet baywet enabled auto-merge (squash) July 9, 2024 15:09
@baywet baywet merged commit 9fa773a into microsoftgraph:main Jul 9, 2024
12 checks passed
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