我今天不得不在一段时间条件下添加无关的括号以避免 pep8 投诉:
while not found and not something and \
(time_left is None or time_left > 0):
(one, two, three, four) = self.gimme(timeout=time_left)
我的解决方案:
while (not found and not something and
(time_left is None or time_left > 0)):
(one, two, three, four) = self.gimme(timeout=time_left)
如果我更改了第 2 行缩进,它会抱怨缩进过度或缺少缩进,从即使是 W 的每个缩进,到它右侧的 8。
我很烦恼添加无关的括号来满足 pep8,几乎没有提高可读性,这违反了一般原则。
有任何想法吗?我错过了更好的解决方案吗?