Skip to content

LGTM.com - false positive - py/missing-equals #8804

Open
@Rongronggg9

Description

@Rongronggg9

Description of the false positive

Talk is cheap, show you the code.

class AbstractClass(abc.ABC):
    def __init__(self):
        self.a = None

class SuperClass(AbstractClass):
    def __init__(self):
        super().__init__()
        self.b = None  # <-- Hey, 'b' is here!

    def __eq__(self, other):
        return type(self) == type(other) and self.a == other.a and self.b == other.b

class SubClass(SuperClass):
     def __init__(self):
        super().__init__()
        self.b = 'b'  # <-- LGTM: The class 'SubClass' does not override '__eq__', but adds the new attribute 'b'.

URL to the alert on the project page on LGTM.com

https://lgtm.com/projects/g/Rongronggg9/RSS-to-Telegram-Bot/snapshot/006cdf55960512e609e7021e4b6785c2d456e3a5/files/src/parsing/medium.py#x1c4917a8f7d52c7f:1

https://lgtm.com/projects/g/Rongronggg9/RSS-to-Telegram-Bot/snapshot/006cdf55960512e609e7021e4b6785c2d456e3a5/files/src/parsing/medium.py#xda2ab04a8ecf9132:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedGitHub staff acknowledges this issuefalse-positivenot securityThis issue does not relate to a security query

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions