Skip to content

E131: inconsistent reporting when comment present on initial line #1055

Open
@fofoni

Description

@fofoni

This (correctly, IMO) produces no warnings:

import foo

dct = {
    'key':
        foo.yadayada() if foo.some_condition()  # raises no warnings
        else foo.blablebli()
}

On the other hand, simply adding a comment on the 'key' line makes it raise E131 on the two most indented lines:

import foo

dct = {
    'key':  # some comment added
        foo.yadayada() if foo.some_condition()  # now, this raises E131
        else foo.blablebli()
}

Using pycodestyle 2.8.0.

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