python代码换行时出现PEP8: continuation line over-indented for visual indent

PyCharm编辑器中,当一行代码太长,需要换行时,使用\符号连接,如:

if first_index \
   < 0 or second_index \
   > self._number_of_plates - 1:

但是编辑器会提示:PEP8: continuation line over-indented for visual indent,可以改用()将代码包在其中,不需要\符号,如:

if (first_index < 0 or
    second_index > self._number_of_plates - 1):

 

转载于:https://my.oschina.net/liyan2013/blog/3082797

你可能感兴趣的:(python,开发工具)