Skip to content

Instantly share code, notes, and snippets.

@AdamGold
Created March 28, 2019 13:06
Show Gist options
  • Save AdamGold/5a76799bbf0af5871d5b242ce9402b81 to your computer and use it in GitHub Desktop.
Save AdamGold/5a76799bbf0af5871d5b242ce9402b81 to your computer and use it in GitHub Desktop.
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