github / github/codeql

LGTM.com - false positive when mixin __init__ calls super().__init__

Offen
#2,455 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
false-positive Python
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

In this case:

```python
class A:
def __init__(self):
pass

class B:
def __init__(self):
super(B, self)

class C(B, A):
pass
```

LGTM reports that `A.__init__()` may not be called, but [it will be called](https://stackoverflow.com/a/39396086/939364).

Actual source code at LGTM.com:
* B: [_SplashResponseMixin](https://lgtm.com/projects/g/scrapy-plugins/scrapy-splash/snapshot/ac847b15e2384acbbefe82ce37f4ad856c33414a/files/scrapy_splash/response.py?sort=name&dir=ASC&mode=heatmap#L22)
* C: [SplashResponse](https://lgtm.com/projects/g/scrapy-plugins/scrapy-splash/snapshot/ac847b15e2384acbbefe82ce37f4ad856c33414a/files/scrapy_splash/response.py?sort=name&dir=ASC&mode=heatmap#L71) (where [Missing call to `__init__` during object initialization](https://lgtm.com/rules/5990072/) is reported)

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.