Skip to content

Conversation

andribas404
Copy link

Relates to #953

pycodestyle.py Outdated
@@ -706,6 +706,8 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing,
# ignore token lined up with matching one from a
# previous line
pass
elif isinstance(visual_indent, list) and text in visual_indent:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm so now this variable can be None, True, False, bytes, str, or a list of str? this seems like we're trying to do too much with dynamicism here -- is there any way to make this easier to understand than overloading the type further?

pycodestyle.py Outdated
@@ -778,6 +780,13 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing,
if start[1] not in indent_chances:
# allow lining up tokens
indent_chances[start[1]] = text
else:
v = indent_chances[start[1]]
if not isinstance(v, (bool, type(None))):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather see:

if list:
   ...
elif str / bytes:
    ...

are all of these branches covered by your tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants