0

In my read_lines function, pylint is giving the error:

R1716: Simplify chained comparison between the operands (chained-comparison)

but unlike the question I found here: Simplify Chained Comparison, my line involves two variables, not one and I'm not really sure how I can simplify it any further:

elif start < 0 and 0 < end < inf:

What am I missing?

SurpriseDog
  • 462
  • 8
  • 18
  • It's suggesting you replace `a < b and b < c` with `a < b < c`. Here, `b` is `0`. – Brian61354270 Apr 09 '21 at 21:49
  • 5
    `start < 0 < end < inf` is what pylint is expecting I assume, though it is debatable whether that actually helps readability. Personally, I would just add a pylint ignore comment, as I don't really think it helps. – SuperStormer Apr 09 '21 at 21:49
  • 1
    @SuperStormer Thanks, didn't think of that. Seems like a case of "Just because you can, doesn't mean you should," lol. – SurpriseDog Apr 09 '21 at 21:52

0 Answers0