python / python/mypy

One case of max iteration count being exceeded.

Offen
#12,458 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

In my project I am encountering the max iteration count problem.
It is working with a list of about 20 modules. After two iterations of analysis, all the modules get deferred, and four of them report making some progress.
The problem is that these modules are making the same progress every time. It is adding an entry to the module's symbol table. However in the next iteration, the symbol is missing from the symbol table and gets added again, resulting in a report of progress being made.
The semanal code is too complicated for me follow. It seems that somehow, the updated symbol table for the module is getting lost and the module state remains at its state before the iteration pass.

I hope this can give you a clue to what to look for in the semanal code that would account for the symbol tables not getting carried over to the next iteration.

I did manage to do some debugging and track down these progress events. One example is in a module:

class InstrValCol(Col[ColKey, ValType], ColAttrsBase, metaclass=CacheMeta):
	...
	class LookupResultTup(NamedTuple):
		status : RowKeyStatus
		value : Optional[ValType] = None

		def __repr__(self):
			repr = self.status.name
			if self.value is not None: repr += f' {self.value}'
			return repr

It is the name __repr__ which is being added to the symbol table every time.

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

Beginne damit, den Code für die wöchentliche Iteration rund um die gemeldeten Fortschrittsereignisse nachzuverfolgen, wobei das Beispiel InstrValCol und sein repr-Symbol als Reproduktionsfall verwendet werden. Verfolge den Modulzustand und die Symboltabelle über die Iterationsdurchläufe hinweg; abgeschlossen bedeutet, dass die aktualisierte Symboltabelle beibehalten wird und dass dasselbe Symbol nicht bei jedem Durchlauf als neuer Fortschritt gemeldet wird.

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
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

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