flanker icon indicating copy to clipboard operation
flanker copied to clipboard

Equality with EmailAddress and String is broken

Open aroberts opened this issue 10 years ago • 1 comments

Flanker's EmailAddress object implements an __eq__ method to support comparison with strings, which is super convenient, but the missing __ne__ (and friends) creates some crazy behavior:

>>> email_address = address.parse('[email protected]')
>>> email_address == '[email protected]'
True
>>> email_address != '[email protected]'
True

Both of these things can't be true, obviously. The answer here is to implement __ne__ and the rest of the python comparison methods.

aroberts avatar Jan 23 '15 17:01 aroberts

Opened PR #79

aroberts avatar Jan 23 '15 17:01 aroberts