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

Allow Zones with different map types. #1015

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Allow Zones with different map types. #1015

merged 2 commits into from
Nov 29, 2023

Conversation

rthalley
Copy link
Owner

Zones currently insist on using a dict, and also the classes WritableVersion and ImmutableVersion. This fix explores allowing any object implementing collections.abc.MutableMapping to be used as the dictionary, and allows the version types to have factories too. Different storage schemes are created by subclassing Zone and changing the factories in the subclass.

I had to change one test that unwisely relied on the order of keys when iterating.

With these changes, I tried two different alternate storage mechanisms and all the tests still pass.

@rthalley rthalley merged commit c1fe3c6 into master Nov 29, 2023
9 checks passed
@rthalley rthalley deleted the zone-map-factory branch November 29, 2023 13:30
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.

1 participant