Skip to content

False positive: pylint does not honour disable-statement when a line is continued with backslash #9834

Open
@abaumfalk

Description

@abaumfalk

Bug description

"""
The following code should lint without errors, but pylint shows:
test.py:14:8: E1101: Instance of 'A' has no 'y' member (no-member)
"""
# pylint: disable=too-few-public-methods, pointless-statement


class A:
    """dummy class"""


a = A()
if a.x or \
        a.y:  # pylint: disable=no-member
    pass

Configuration

No response

Command used

pylint test.py

Pylint output

************* Module test
test.py:14:8: E1101: Instance of 'A' has no 'y' member (no-member)

Expected behavior

error should be suppressed because of disable=no-member

Pylint version

pylint 3.2.6
astroid 3.2.4
Python 3.10.12

OS / Environment

$ uname -a
Linux xxx 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions