-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Support for python 3.10 match statement #10191
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
3847124
Add Nodes needed for match statement support
freundTech f9e9277
Added match statement support to StrConv visitor
freundTech 6c4109f
Added match statement support to TraverserVisitor
freundTech 289d014
Move MatchAs and MatchOr to patterns and add literal patterns
freundTech 1973a88
Added nodes for capture and wildcard patterns
freundTech cc92db4
Added nodes for value, sequence and mapping patterns
freundTech 057716c
Added nodes for class patterns
freundTech 6bfb098
Added parser tests for pattern matching and tweaks to pattern classes
freundTech a74b0e6
Added patterns to NodeVisitor and TraverserVisitor
freundTech fc3c1d2
Add missing parse test and prevent tests from running on < 3.10
freundTech db04186
Add parse tests for open sequence patterns
freundTech eeca25b
Added match statement support to SemanticAnalyzerPreAnalysis
freundTech cc76f59
Also consider pattern in SemanticAnalyzerPreAnalysis
freundTech 36a45b3
Use common base classes instead of unions for patterns
freundTech 7facb0d
Added match statement support for variable renaming (allow-redefinition)
freundTech 1bc8a4b
Added match statement support for SemanticAnalyzer
freundTech d26d81c
Moved int from types to builtin stubs in order to extend int
freundTech 3effadc
Added initial version of match statement type checking
freundTech 3aab780
Use double quotes in error messages
freundTech 3a71c32
Add support for match statement self matching class patterns
freundTech b7468d9
Replace more single quotes in tests with double quotes
freundTech 943f2ff
Add support for __match_args__ to dataclass
freundTech b41fa30
Minor code cleanup
freundTech 037a140
Add support __match_args__ to namedtuple
freundTech fb9ae47
Add support for match statement as pattern and change type_stack to Type
freundTech 99c1bbf
Make PatternChecker infer unions for patterns with the same name
freundTech 0e47d6f
Implemented match_args parameter for dataclasses (bpo-43764)
freundTech 77b997b
Refactor PatternChecker
freundTech 5228bc7
Add match statement support for or pattern
freundTech bba61fa
Fix make_simplified_union for instances with last_known_value
freundTech 39478fd
Infer literals from literal patterns in match statements
freundTech a865882
Infer the rest pattern for mapping patterns
freundTech c35d921
Adjust ASTConverter to use dedicated pattern nodes
freundTech 1aae2c1
Improve type inference for tuples checked against sequence patterns
freundTech 1364a67
Merge remote-tracking branch 'upstream/master' into feature-match-stmt
freundTech 32a7b71
Fix linter errors
freundTech 25fe496
Sync typeshed
freundTech 86a6ce9
Fix sequence pattern outer type check to be in line with PEP 634
freundTech 9445c10
Merge remote-tracking branch 'upstream/master' into feature-match-stmt
freundTech 74c7040
Remove accidentally commited changes
freundTech c964027
Fix failing TypeExport tests
freundTech f6b1752
Improve type inference for mapping pattern rest
freundTech d2b7d1e
Improve class pattern subpattern type inference
freundTech 5c47852
Fix selftest failing
freundTech 0ac21d0
Fix mypyc build failing
freundTech 7db936b
Merge remote-tracking branch 'upstream/master' into feature-match-stmt
freundTech 5f98cdd
Fix another mypyc build error
freundTech 423b04c
Merge remote-tracking branch 'upstream/master' into feature-match-stmt
freundTech f2e12f8
Fix failing tests after merge (Caused by #8578)
freundTech a5eb480
Fixed more failing tests after merge (Caused by #10685)
freundTech 9d5d600
Adjust some tests and add new ones
freundTech a68ea59
Fixed types staying narrowed after match statement
freundTech 43fd6e5
Run com2ann and fix errors
freundTech d7baadf
Split conditional_type_maps into two functions
freundTech 8a3ba8e
Readd removed workaround as the problem is still present
freundTech 90aa1a7
Disable Exhaustiveness test for now
freundTech de723e1
Fixed checking of nested list statements failing
freundTech 3fb2cf2
Fixed mypy crashing when list statement can't match
freundTech ab7a2e3
Moved test to correct category
freundTech 45e2abe
Simplify conditional_types
freundTech 44ca265
Generate intersection types in match statements and add guard tests
freundTech 21f7b59
Fixed broken tests
freundTech bfb578d
Fix mypy_primer differences
freundTech 909fc55
Merge remote-tracking branch 'upstream/master' into feature-match-stmt
freundTech c0a43e8
Fix type errors
freundTech f768993
Fixed copy-paste error causing mypyc crash
freundTech 7b60596
Added semanal tests for undefined value and class patterns
freundTech 6cf9f58
Removed redundant bool from lib-stubs
freundTech 268e181
Removed tuple from lib-stub
freundTech dbcd886
Fix typo in test
freundTech bd7e777
Fixed testcase and marked it as skip
freundTech f51c83f
Moved messages to message_registry
freundTech 4d87ca1
Removed outdated comment
freundTech 9f9efcc
Removed full stop from error message
freundTech 68bd2ba
Change test case to new error message
freundTech ff5123c
Report error for non-existing keywords on class patterns
freundTech 13b675b
Merge remote-tracking branch 'upstream/master' into feature-match-stmt
freundTech e437323
Fixed dataclasses plugin after merging master.
freundTech 68a09ee
Added more comments and asserts to pattern classes
freundTech a5baf60
Readd tuple missing tests
freundTech 4add6b7
Merge remote-tracking branch 'upstream/master' into feature-match-stmt
freundTech eabeb89
Merge remote-tracking branch 'upstream/master' into feature-match-stmt
freundTech 53d40f8
Added missing Final annotations
freundTech 52dc066
Add comments and clarify some names
freundTech 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
Moved int from types to builtin stubs in order to extend int
- Loading branch information
commit d26d81c3c3305d8912d639a06ee5561241c6115f
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.