Created
March 28, 2019 13:06
-
-
Save AdamGold/5a76799bbf0af5871d5b242ce9402b81 to your computer and use it in GitHub Desktop.
This file contains 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
def __setitem__(self, key: str, value: Any) -> int: | |
"""allow insertion of items with object[key] = value""" | |
entry = Entry(key, value) | |
index = entry.hash % self.actual_size | |
self.entries[index] = entry | |
return index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment