github / github/codeql

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

Abierto
#7,451 2 comentarios 0 reacciones 0 asignados Ver en GitHub
acknowledged false-positive not security Python
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

**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**](https://lgtm.com/projects/g/mdabrowski1990/uds/snapshot/857b583568c0a441827dc326dad749c389faf8a7/files/uds/packet/can_packet.py?sort=name&dir=ASC&mode=heatmap#x80c19aa17f79eb08:1)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.