consider-ternary-expression / W0160#
Consider rewriting as a ternary expression
Multiple assign statements spread across if/else blocks can be rewritten with a single assignment and ternary expression
x, y = input(), input() if x >= y: # [consider-ternary-expression] maximum = x else: maximum = y
x, y = input(), input() maximum = x if x >= y else y
- This message is emitted by the optional 'consider_ternary_expression'
checker which requires the
pylint.extensions.consider_ternary_expressionplugin to be loaded.
Created by the consider_ternary_expression checker.