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

Fix Python 3.9 compatibility for FrozenDict due to PEP 584 implementation. #271

Merged
merged 1 commit into from
Nov 23, 2020
Merged

Fix Python 3.9 compatibility for FrozenDict due to PEP 584 implementation. #271

merged 1 commit into from
Nov 23, 2020

Conversation

tirkarthi
Copy link
Contributor

Python 3.9 implements PEP 584 that supports union using | and |=. It also implements __or__, __ior__ and __ror__. In these methods __ior__ mutates the dictionary which shouldn't be done for FrozenDict. Python 3.8 and below raise TypeError since | and |= are not implemented but |= goes through for Python 3.9 hence add it to the list of methods that raise TypeError.

Fixes #270

@mahmoud
Copy link
Owner

mahmoud commented Nov 23, 2020

Great sleuthing! I saw threads about that bouncing around python-dev, I should have anticipated it'd cause issues here. Glad someone caught it and fixed it! So thank you.

Test looks good, too, this'll go out in the next release sometime in the next couple weeks I imagine. Thanks again!

@mahmoud mahmoud merged commit 754afdd into mahmoud:master Nov 23, 2020
@tirkarthi
Copy link
Contributor Author

Thanks @mahmoud

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.

python 3.9 test failure version 20.2.1
2 participants