nbro / andz

Algorithms and data structures for educational, demonstrational and experimental purposes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not all methods of the LinearProbingHashTable class check if the input key is Hashable

nbro opened this issue · comments

commented

The following methods do not check if the key is an instance of an Hashable

  • get
  • put

whereas the following do

  • delete

Note: update tests to reflect changes.

commented

The methods get and put did not specifically check if the key is an instance of Hashable, but, anyway, they would raise a TypeError in that case, because they perform at least one call to _hash_code method, which uses the Python built-in function hash.