python / python/mypy

Results vary with the order of the specified files.

Aperta
#12,592 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
Python
Stelle
20.6k
Fork
3.3k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

I have a project with many modules. A group of 30 of them are in a cyclic import SCC.

I ran mypy under Visual Studio. While trying to see why some errors appeared, I ran a copy of the mypy code with a debugger. I noticed that I got quite a different set of errors reported.
The difference was that Visual Studio passes filenames to mypy in the order that it finds them in the project, whereas I used "mypy ." for the debugging. mypy processed the same set of input files, but in a different order.

I made a names file with the names in the order used by VS, and then ran mypy using this names file, with same result as running under VS.

I've collected log files from both runs. They include a bunch of extra messages which I put into my code, so as to help me figure out what was going on. It includes details about imports and symbol definitions in this SCC, and two files, cache and solver.common in particular.

I have attached a zip with these logs. It also includes just the error messages extracted from the logs. You will see the greatly different results. 148 errors in one case and 93 errors in the other case.

It's apparent to me that the order of the files in this SCC is what makes the difference. I will be looking at what in detail is different and why that is happening. It has something to do with marking a module as incomplete when it imports * from another incomplete module, and some, but not all, of the needed symbols are imported only during the final iteration.

However, in the meantime, here are the output files, if you want to see what you can make of them. The order of the SCC is shown in line 873 of each log file.
Exp.zip

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando i log Exp.zip allegati e confronta le due esecuzioni, concentrandoti sull’ordine degli SCC mostrato alla riga 873 e sulle diverse diagnosi. Traccia il comportamento di incomplete-module e import-* descritto nel report; il lavoro è completato quando l’elaborazione degli stessi file di input non modifica più gli errori riportati in base al loro ordine.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.