Skip to content Skip to sidebar Skip to footer
Showing posts with the label Hashable

Using @functools.lru_cache With Dictionary Arguments

I have a method that takes (among others) a dictionary as an argument. The method is parsing string… Read more Using @functools.lru_cache With Dictionary Arguments

Recommended Way To Implement __eq__ And __hash__

The python documentation mentions that if you override __eq__ and the object is immutable, you shou… Read more Recommended Way To Implement __eq__ And __hash__

Hashable Data Structure With No Order And Allowed Duplicates

I have list of tuples/lists (-1, 0, 1) (-1, 1, 0) (-1, 2, -1) (-1, -1, 2) (0, 1, -1) I need them to… Read more Hashable Data Structure With No Order And Allowed Duplicates

Making A List Subclass Hashable

I want to derive a class from list, add a few instance attributes to it, and make it hashable. What… Read more Making A List Subclass Hashable