python / python/mypy

maximum semantic analysis iteration count reached with importing two dataclasses modules

Offen
#10,892 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

crash semantic-analyzer topic-dataclasses
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Crash Report

Deferral trace:
    databind.core.dataclasses_test:35
    databind.core.dataclasses_test:35
    [...]
    databind.core.dataclasses_test:35
    databind.core.dataclasses_test:35
src/databind/core/dataclasses_test.py: error: INTERNAL ERROR: maximum semantic analysis iteration count reached
Found 1 error in 1 file (errors prevented further checking)

My project has a databind.core.dataclasses module which is supposed to be used as a drop-in replacement for dataclasses. In the unittests dataclasses_test, I import both of these modules but doing that crashes Mypy.

I haven't been able to come up with a smaller scenario to reproduce the issue.

Traceback

--show-traceback does not give any additional information other than what is shown above.

To Reproduce

  1. Clone https://github.com/NiklasRosenstein/databind.git and check out 74c5c6e
  2. Change directory into databind.core
  3. Install mypy pytest types-setuptools
  4. Run mypy src and not how there are no errors
  5. Open src/databind/core/dataclasses_test.py and insert import dataclasses at the top of the file
  6. Run mypy src again (you will see the error)

Your Environment

  • Mypy version used: 0.910
  • Mypy command-line flags: n/a
  • Mypy configuration options from mypy.ini (and other config files): n/a
  • Python version used: 3.9.6
  • Operating system and version: osx

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere den Fehler aus Commit 74c5c6e in databind, indem du import dataclasses zu src/databind/core/dataclasses_test.py hinzufügst, und führe anschließend mypy src mit mypy 0.910 aus. Vergleiche den erfolgreichen Lauf vor dem Import mit dem Fehler „maximum semantic analysis iteration“ danach; fertig ist die Änderung, wenn das Importieren beider Module nicht mehr den internen Fehler erzeugt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
compilers
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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