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

Unify NoSql and StoredDict Keys #104

Merged
merged 2 commits into from
Apr 26, 2021
Merged

Unify NoSql and StoredDict Keys #104

merged 2 commits into from
Apr 26, 2021

Conversation

domenukk
Copy link
Member

This (somewhat) addresses #3, by making sure keys are always stringified on set and retrieve.
It does not address non-string keys for nested dicts.

@domenukk domenukk requested a review from ldruschk April 25, 2021 19:07
Copy link
Member

@ldruschk ldruschk left a comment

Choose a reason for hiding this comment

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

lgtm, although we should probably check how mypy deals with Union[NoSqlDict, StoredDict] and whether the type checks for __geitem__/__setitem__ emit a warning when using non-string keys

@domenukk
Copy link
Member Author

domenukk commented Apr 26, 2021

The set and getitem calls for StoredDict always took str.
We can also change them both to always be of the Any type, since we now stringify them in any case.

@ldruschk
Copy link
Member

I would rather let them be str and have a warning emitted if possible when using non-str keys

@domenukk domenukk merged commit 0a21ced into main Apr 26, 2021
@domenukk domenukk mentioned this pull request Apr 26, 2021
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