gh-123344: Add missing ast optimizations for PEP 696#123377
gh-123344: Add missing ast optimizations for PEP 696#123377JelleZijlstra merged 4 commits intopython:mainfrom
Conversation
| f"{ast.dump(optimized_tree)}", | ||
| ) | ||
|
|
||
| def create_binop(self, operand, left=ast.Constant(1), right=ast.Constant(1)): |
There was a problem hiding this comment.
| def create_binop(self, operand, left=ast.Constant(1), right=ast.Constant(1)): | |
| def create_binop(self, operand, left=None, right=None): |
please, don't use complex objects as defaults
There was a problem hiding this comment.
This seems fine as is; it's more convenient to write many of the remaining tests this way.
There was a problem hiding this comment.
I am in a purist camp :) But, this is minor, I agree. Since these objects aren't ever mutated, this does not introduce any problems.
There was a problem hiding this comment.
Yeah, I also don't like mutable defaults. But this one looks not very complex and it doesn't seem to be mutated anytime soon :) We can rewrite it, but the diff would be much larger
Misc/NEWS.d/next/Core and Builtins/2024-08-27-13-16-40.gh-issue-123344.56Or78.rst
Outdated
Show resolved
Hide resolved
…e-123344.56Or78.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
Thanks @wrongnull for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
GH-123427 is a backport of this pull request to the 3.13 branch. |
Uh oh!
There was an error while loading. Please reload this page.