From 5a86fddcb815ebd08fbc3ffcbaf7b11c2ba2e107 Mon Sep 17 00:00:00 2001 From: Justin Li Date: Fri, 21 Dec 2018 00:08:25 -0800 Subject: Generalize `chained-comparison` (#2655) `chained-comparison` detects boolean expressions such as `a < b and b < c` and suggests it should be rewritten as `a < b < c`. The current implementation is limited in two ways. First, cannot deal with existing chain comparisons, so it would not detect the following: `a < b < c and c < d` # should be a < b < c < d Second, the algorithm for detecting possible chains is simplistic, and would falsely detect the following: `a < b < c and b < d` # no simplification possible This change fixes both of these issues. --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index e6b0ffe1f..d4ed3616c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -70,6 +70,11 @@ Release date: TBA Close #2565 +* Generalize ``chained-comparison`` + + Previous version incorrectly detects `a < b < c and b < d` and fails to + detect `a < b < c and c < d`. + What's New in Pylint 2.2.2? =========================== -- cgit v1.2.1