-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add flag to allow more flexible variable redefinition #18727
Open
JukkaL
wants to merge
80
commits into
master
Choose a base branch
from
new-allow-redefine
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
9735391
WIP some initial prototyping
JukkaL 946d4d5
WIP add failing test case
JukkaL 7f7e25f
WIP minimal support for merging control flow
JukkaL 0c9f049
Add globals test case
JukkaL 9935537
Add class body test case
JukkaL fd12f85
Require --local-partial-types
JukkaL b489b6a
Fix optional types
JukkaL d2b7558
Add partial type test cases
JukkaL 63bf0af
Pass options consistently
JukkaL ec02654
Fix interaction with Final
JukkaL 4290857
Add annotated variable test case
JukkaL 5c8ab17
Add test
JukkaL c116451
Add failing test
JukkaL 9794308
Only use type context in assignment if inference fails without type c…
JukkaL a355473
Always use type annotation as context
JukkaL 8162a45
Add while loop test case
JukkaL b1f75a7
Fix type inference in loops
JukkaL 62dfbb0
Update tests
JukkaL bb6a246
Remove underscore special case
JukkaL 51c61c7
Don't perform renaming when using new semantics
JukkaL 0384795
Fix for loops
JukkaL a003c83
WIP failing tests
JukkaL a35870e
Add try/except test case
JukkaL dea9148
Add match statement test
JukkaL 2b104dc
Add simple nested function test case
JukkaL 6a05baf
Update globals tests case
JukkaL b58be6a
Add assignment expression test case
JukkaL 5b31950
Add lambda test case
JukkaL bcaace1
Tests for imports
JukkaL ad90125
Add operator assignment test case
JukkaL 106577d
WIP add break/continue tests (failing)
JukkaL ea6f13b
WIP del test (failing)
JukkaL 71deb24
Add return test (failing)
JukkaL b3cc74a
Fix binder issues
JukkaL 172bcf2
Various binder fixes and test updates
JukkaL 9353132
Add default arg test case
JukkaL 13b7aa3
Add max iterations check to processing loops
JukkaL f1223df
Fix try statement within loop
JukkaL d4445de
Fix indexed literals
JukkaL b3b1e9e
Put types of parameters and annotated variables to the binder
JukkaL 06ed1e9
Fix self check
JukkaL 9f48a19
Update tests
JukkaL f5a1915
Improve repr of Var nodes
JukkaL 6ca4d76
Fix match statements by reusing dummy Var node
JukkaL 9fde15f
Fix crash from inferring union with partial type item
JukkaL abf4eac
Add tests
JukkaL 71cdb61
Add test cases for "del"
JukkaL 69fca07
Rename flag to --allow-redefinition-new
JukkaL 5ee1868
Rename tests
JukkaL b8a106d
Suppress from --help, since this is experimental
JukkaL bf75cc4
Add and update tests
JukkaL 9585353
Minor tweaks
JukkaL 0efa85d
Refactor
JukkaL 4af080c
Black and ruff
JukkaL c478514
More tweaks
JukkaL fb9421f
Prevent wideding of variable defined in outer scope
JukkaL a29a3dc
Add comment
JukkaL ff7557b
Fix issue
JukkaL 10b6082
Some polish
JukkaL e8789e0
Don't widen final variables
JukkaL 9494ddc
Fix incremental mode
JukkaL fed6d45
Simplify
JukkaL aaefd4b
Detect invalid per-module options
JukkaL d7c35e4
Fix typo
JukkaL 5bd6def
Skip failing match statement test on 3.9
JukkaL 3e38e7d
Don't infer infinitely complex types in loops
JukkaL 65f4785
WIP add failing test cases
JukkaL 179b846
Avoid inferring a partial type for "_"
JukkaL 2b711e2
Fix binder issue with unions containing Any
JukkaL 14524fe
Improve error message
JukkaL 37098d6
Address review
JukkaL 808f6e3
Address more review comments
JukkaL 4317961
Update comment
JukkaL 460ebe4
Update comments
JukkaL 2c6a144
Address more comments
JukkaL daf9c75
Add TODO comments
JukkaL 69fd839
TEMPORARY: Enable --allow-redefinition-new and --local-partial-types
JukkaL a5adfd7
Preserve TypedDicty type context more aggressively for backward compat
JukkaL 2dba308
Backward compatibility fix
JukkaL ac852e6
Fix self check
JukkaL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite tricky and with time we may forget what
old_semantics
mean. I think it is worth adding a comment with motivating code example here.