On 07/07/2014 06:18 PM, Andreas Maier wrote: > Am 2014-07-08 01:50, schrieb Ethan Furman: >> >> I never add __eq__ to my classes until I come upon a place where I need to check if two instances of those classes are >> 'equal', for whatever I need equal to mean in that case. > > With that strategy, you would not be hurt if the default implementation raised an exception in case the two objects are > not identical. ;-) Yes, I would. Not identical means not equal until I say otherwise. Raising an exception instead of returning False (for __eq__) would be horrible. -- ~Ethan~
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4