报告可以简化的链式比较。
示例:
def do_comparison(x):
xmin = 10
xmax = 100
if x >= xmin and x <= xmax:
pass
IDE 提议简化 if x >= xmin and x <= xmax
。
应用快速修复后,代码变为:
def do_comparison(x):
xmin = 10
xmax = 100
if xmin <= x <= xmax:
pass