Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
sbassi
· 4y ago · 0 comments
Equal to which class? If I have MyClass1 and MyClass2 with different body, after revolution, MyClass1 will be like MyClass2 or MyClass2 like MyClass1?
Comments
[–]
kjgkjhfkjf
4y ago
It patches each class's __eq__ and __hash__ so they return True and hash(1) respectively.
[–]
pdonis
4y ago
Yes, which means they also compare equal to
any
object whatever, and they hash equal to the integer 1 and the boolean True.
[–]
swebs
4y ago
Reminds me of the silliness you'd see in "C Plus Equality"
https://github.com/TheFeministSoftwareFoundation/C-plus-Equa...