Skip to content

[LGTM.com - false positive] py/conflicting-attributes for abstract and concrete attribute #7451

Open
@mdabrowski1990

Description

@mdabrowski1990

Description of the false positive

I have a class that inherits after two classes (abstract and parent with implementation). The conflicting attribute is False-Positive because abstract class just defines abstract property that is inherited after parent class.

Example:

  • abstract class
from abc import ABC, abstractmethod

class Abstract(ABC):
    @property
    @abstractmethod
    def attribute(self):
         """Abstract atr"""
  • parent class
class Parent:
    @property
    def attribute(self):
        return "some expression"
  • child class
class Child(Parent, Abstract):  # <- alert reported
    ...  # some additional code is here

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions