python - How to use continuation line over-indented for visual indent? -
i'm having hard time trying fix piece of code in order fit pep8's guidelines. have tried breaking line backslash , enclosing set of brackets. furthermore, made sure second line came right after position first right bracket.
if (len(self._stools[origin]) > 0 , len(self._stools[dest]) , self.top_cheese(origin).size > self.top_cheese(dest).size): raise illegalmoveerror
thus, every time run pep8.py on piece of code get:
toahmodel.py:94:14: e127 continuation line over-indented visual indent.
i'm guessing getting "continuation line not distinguish next logical line". solution move second line indent -
if (len(self._stools[origin]) > 0 , len(self._stools[dest]) , self.top_cheese(origin).size > self.top_cheese(dest).size): raise illegalmoveerror
the reason self.top_cheese(origin).size
@ same indent level raise illegalmoveerror
, can difficult reader, because might not obvious if statement ends , actual block within if statement begins. can argue not better, that's way is.
Comments
Post a Comment