-
-
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.
[used before def] rework builtin handling (#14483)
When doing multiple passes, in the example below, `range` will refer to current's module range. When doing a single pass, `range` will refer to `builtins.range`: ```python _range = range _C = C # error: Name "C" is used before definition class range: pass class C: pass ``` Instead of looking at the output of semanal to check if a variable is resolving to a `builtins` package, we can just check if it's part of builtins module. Fixes #14476.
- Loading branch information
Showing
3 changed files
with
27 additions
and
8 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
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