consider-using-ternary / R1706ΒΆ

Message emitted:

Consider using ternary (%s)

Description:

Used when one of known pre-python 2.5 ternary syntax is used.

Problematic code:

x, y = 1, 2
maximum = x >= y and x or y  # [consider-using-ternary]

Correct code:

x, y = 1, 2
maximum = x if x >= y else y

Created by the refactoring checker.