One case of max iteration count being exceeded.

オープン
#12,458 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
compilers

調査の方向性

まず、報告された進捗イベント周辺の週次イテレーションコードを追跡し、InstrValCol の例とその repr シンボルを再現ケースとして使用します。イテレーションの各パスにわたってモジュールの状態とシンボルテーブルを追跡します。完了とは、更新されたシンボルテーブルが保持され、同じシンボルが各パスで新しい進捗として報告されないことを意味します。

索引モデルが issue の本文から書いたものです。

説明

crash semantic-analyzer topic-named-tuple

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.

主要言語
Python
スター
20.6k
フォーク
3.3k
平均マージ
1日 18時間
マージ済み PR(30日)
54

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python/mypy のほかの issue

python/mypy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。