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

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__

How To Check If A Variable Is The Same As At Least One Of Two Other Variables?

I have a variable, and want to check if it matches at least one of the other two variables. Clearly… Read more How To Check If A Variable Is The Same As At Least One Of Two Other Variables?

When Is The `==` Operator Not Equivalent To The `is` Operator? (python)

I noticed I can use the == operator to compare all the native data types (integers, strings, boolea… Read more When Is The `==` Operator Not Equivalent To The `is` Operator? (python)