pylint-bot / pylint-unofficial

UNOFFICIAL playground for pylint github migration
0 stars 0 forks source link

[regression] unneeded-not in 1.5.0 #716

Open pylint-bot opened 8 years ago

pylint-bot commented 8 years ago

Originally reported by: BitBucket: bossylobster


When doing a set comparison

"""Small set example."""

LEFT_VALS = 'bad'
RIGHT_VALS = 'akbar'

if not set(LEFT_VALS) <= set(RIGHT_VALS):
    print 'Left vals are not contained'

and the error (not present in 1.4.4, but appeared in 1.5.0) is suggesting something which is not mathematically equivalent:

************* Module set_example
C:  6, 3: Consider changing "not set(LEFT_VALS) <= set(RIGHT_VALS)" to "set(LEFT_VALS) > set(RIGHT_VALS)" (unneeded-not)

The issue is that the integers (or reals) are totally ordered but sets are not totally ordered.