-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One case of max iteration count being exceeded. #12458
Comments
Another module with this behavior, but a different sort of item with multiple progress:
The
Lo and behold! The symbol never got added at all, because it was forever determined to be incomplete. Note: the |
@AlexWaygood I tried making a project with just the one module, but then mypy behaved correctly. Further investigating, I found that |
Found one bug |
By the way, I didn't mean to close this issue earlier. I hit the wrong button. Sorry about that! |
Fixes for bugs
This prevents repetitive progress indications for the same For recognizing user-defined methods of a
I tested this code on my project. I tracked all the places where the progress flag is set, and of all the situations where there were infinite progress flags before, now each of these occurs exactly once. Something odd that I did notice in this test. During the final iteration (number 5 in this case), some more progress flags were set. They were ignored since this was the final iteration. However, it indicates that some progress was made in iteration 4. It pertained to Perhaps we all should have a discussion about what "making progress" means in these iterative scenarios, and how it should be implemented. Broadly speaking, I interpret it to mean that if another pass through the remaining incomplete modules in the SCC will have different results, then the current pass has made progress. |
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:
It is the name
__repr__
which is being added to the symbol table every time.The text was updated successfully, but these errors were encountered: