-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mypyc] Fix evaluation of iterable in list comprehension twice
This could result in a crash if the second evaluation results in a shorter list, such as in this example (besides being incorrect overall): ``` a = [s for s in f.readlines()] ``` `f.readlines()` was called twice, resulting in an empty list on the second call. This caused the list object to have a NULL item, which is invalid. This should fix `mypy --install-types` in compiled mode.
- Loading branch information
Showing
2 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters