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

🐛 should never use mutable defaults in class definitions #96

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

ianardee
Copy link
Contributor

🐛 mutable defaults in classes

We should never use mutable defaults in class definitions.

These work the same way as mutable defaults in function definitions, but are not checked by mypy it seems.

Consider using dataclasses in a future version.
https://docs.python.org/3/library/dataclasses.html#mutable-default-values

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@ianardee ianardee merged commit 776099a into main Aug 26, 2022
@ianardee ianardee deleted the fix-mutable-defaults branch August 26, 2022 13:35
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