Skip to content

PEP8 backslash exception for with statements is not honored #202

Description

@ergoithz

Given this example, explicitly allowed by PEP8 (lit. Backslashes may still be appropriate at times. For example, long, multiple with-statements cannot use implicit continuation, so backslashes are acceptable):

async def fnc():
    async with asdf() as a, \
               bsdf():
        return 1

with asdf() as a, \
     bsdf():
    return 1


with \
  asdf() as a, \
  bsdf():
    return 1

This plugin gives many non-PEP8-compliant false positives:

test_continuation.py:2:1: N400: Found backslash that is used for line breaking
    async with asdf() as a, \
               bsdf():
^
test_continuation.py:6:1: N400: Found backslash that is used for line breaking
with asdf() as a, \
     bsdf():
^
test_continuation.py:11:1: N400: Found backslash that is used for line breaking
with \
  asdf() as a, \
  bsdf():
^
test_continuation.py:12:3: N400: Found backslash that is used for line breaking
with \
  asdf() as a, \
  bsdf():
  ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions