-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
gh-144639: Ruff: target Python 3.14 syntax in Lib/test
#144656
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
base: main
Are you sure you want to change the base?
Conversation
picnixz
left a comment
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.
I would suggest that we keep the old syntax but keep the ruff update. Btw ISTM that this new syntax is similar to the old print syntax which was then replaced by the () form so I still struggle to parse this.
| pyc_file = importlib.util.cache_from_source(source) | ||
| shutil.move(pyc_file, legacy_pyc) | ||
| except (FileNotFoundError, NotImplementedError): | ||
| except FileNotFoundError, NotImplementedError: |
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.
Any reason for this specific change? (or is it a ruff change?)
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.
It's a manual change.
Please see the linked issue: @brettcannon had suggested it in a PR (#144293) but it had to be reverted because our tools wouldn't let us use 3.14 syntax in 3.15 tests.
AlexWaygood
left a comment
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.
I like the new syntax: it means less noisy punctuation, and it's similar to the way that tuples don't need parentheses to be tuples.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Yeah this kind of syntax is also annoying for me except for destructuring... (I always put parentheses around my tuples except when doing a |
|
I think the SC accepting PEP 758 is a pretty good signal that it's okay to use :) This is modern Python.
Ironically, your full last comment has three opening parentheses, but only two closing ones! Or perhaps an argument for using fewer parentheses ;) |
Yeah I saw that! well it is an argument for using fewer but it won't help me when reading (when writing it could!) |
|
Btw, the only place where I found the missing parentheses in tuples was in the stdlib. I didn't see other codes doing it actually so I never knew about it! (I only learned about it when looking at our tests...) |
Huh, I think it's fairly common to do |
Uh oh!
There was an error while loading. Please reload this page.