Enhancements to File, LMDB, Zip#95
Merged
Merged
Conversation
c77132e to
72cedae
Compare
72cedae to
84080bc
Compare
j-bennet
reviewed
Mar 31, 2023
| try: | ||
| v = self._mapping[key] | ||
| except (KeyError, AttributeError): | ||
| except KeyError: |
Collaborator
Author
There was a problem hiding this comment.
See LMDB.__getitem__. Before, non-string keys would raise AttributeError (from _encode_key); now they raise KeyError.
j-bennet
reviewed
Mar 31, 2023
| """z does not accept any Python object as values. | ||
| Test that it reacts correctly when confronted with an invalid value type. | ||
| """ | ||
| bad = object() |
Collaborator
Author
There was a problem hiding this comment.
Such is specifically the signature of LMDB, Zip, and File. They're not MutableMapping[KT, VT]; they're MutableMapping[str, bytes].
j-bennet
approved these changes
Mar 31, 2023
j-bennet
left a comment
There was a problem hiding this comment.
Looks good, I just had a couple of questions. 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Zip.__contains__no longer reads the value from diskZip.__setitem__will now raise when updating an already-existing key instead of quietly corrupting the mapping