vaab / colour

Python color representations manipulation library (RGB, HSL, web, ...)
BSD 2-Clause "Simplified" License
319 stars 41 forks source link

fix: dev: added inequality method (fixes #26) #28

Closed tommilligan closed 7 years ago

tommilligan commented 7 years ago

This fixes issue #26 where checking if two Color objects were not equal (using !=) always returned True.

PR includes tests. I don't think additional changes to documentation are required.

This PR is based on the master branch, as the dev branch is currently failing build for Python 3.4.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.4%) to 98.729% when pulling 6f9167ada9d67df636eadd9d514b49a9ca8956a6 on tommilligan:master into 69f5add6564d581c656e89a98fe7ab31b0b4836b on vaab:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.4%) to 98.729% when pulling 6f9167ada9d67df636eadd9d514b49a9ca8956a6 on tommilligan:master into 69f5add6564d581c656e89a98fe7ab31b0b4836b on vaab:master.

tommilligan commented 7 years ago

Root cause was that the Color class already has a custom __eq__ method, but no custom __ne__ method.

This PR:

vaab commented 7 years ago

Ok, many thanks. I'm in the process of reviewing your code and going into the #25 cases you've brought up. As a first notice, I'm not very keen upon adding this _is_comparable(..) method, and I'll look into enforcing python 3 default behavior as I understand it (which should be to use not ==).

I have posted another PR #29, feel free to comment !

vaab commented 7 years ago

I pushed the other PR #29 that tackle the same issue a little differently. If anything is wrong with that, please voice your concern. Thanks !