Addresses should not equal things that are not addresses.

Review Request #3791 - Created April 29, 2016 and submitted

Information
Nick Howard (Twitter)
pants
3306
Reviewers
pants-reviews
benjyw, jsirois, molsen

Currently addresses return NotImplemented when other is not an instance of Address. That's fine, but __ne__ calls __eq__ without checking for NotImplemented, which is truthy, so address != not_an_address will return False.

This changes __eq__ to return False instead, and adds a regression assertion. It also updates __ne__ so that it uses the operator so that it can't propagate NotImplemented even if it might otherwise have been propagated.

Ran address tests locally, CI away in PR.

Matt Olsen
John Sirois
Stu Hood
Nick Howard (Twitter)
John Sirois
Nick Howard (Twitter)
John Sirois
Stu Hood
Nick Howard (Twitter)
Nick Howard (Twitter)
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted as https://github.com/pantsbuild/pants/commit/0ea93e789eeb87c3bcee2dc0097e2a1d191a9057
Loading...