bpo-44589: raise SyntaxError when mapping pattern has duplicate key#27131
bpo-44589: raise SyntaxError when mapping pattern has duplicate key#27131brandtbucher merged 12 commits intopython:mainfrom
Conversation
* match case pattern cannot have duplicate keys per PEP 634. * when duplicate literal values are present, a syntax error should be raised; not a runtime ValueError, which was the prior behavior.
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Looks good to me in general. I'm not a compiler expert though. Thanks for taking this up :).
|
The docs at https://docs.python.org/3.11/reference/compound_stmts.html#mapping-patterns also need fixing.
and
require more clarification. The file for that doc is at https://github.com/python/cpython/blob/main/Doc/reference/compound_stmts.rst |
|
@Fidget-Spinner re: Documentation, I tweaked the docs. See aeb4c42 |
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
Thank you very much for your feedback!! I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @brandtbucher: please review the changes made to this pull request. |
brandtbucher
left a comment
There was a problem hiding this comment.
Nice, thanks for the quick changes.
I have a few minor suggestions, but I consider this merge-ready and will land it EOD regardless.
Misc/NEWS.d/next/Core and Builtins/2021-07-13-23-19-41.bpo-44589.59OH8T.rst
Outdated
Show resolved
Hide resolved
|
@brandtbucher ok, those final changes have all been made in 00886a5 |
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @brandtbucher: please review the changes made to this pull request. |
|
Thanks @jdevries3133 for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
GH-27157 is a backport of this pull request to the 3.10 branch. |
…iteral keys (pythonGH-27131) (cherry picked from commit 2693132) Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
raised; not a runtime ValueError, which was the prior behavior.
Tests have been updated to test the new behavior. Docs were not changed, because the behavior is now more closely aligned with the documentation and the PEP.
https://bugs.python.org/issue44589