-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow Python 3.15 as valid target-version value in preview
#22419
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
Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
| pub const fn latest_ty() -> Self { | ||
| // Make sure to update the default value for `EnvironmentOptions::python_version` when bumping this version. | ||
| Self::PY314 | ||
| Self::PY315 |
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.
We should not change latest or latest_ty before we have stable Python 3.15 support
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.
latest and latest_ty set back to 314.
|
Is this just a byproduct of the changes from that PEP? I don't see anything about |
6580de1 to
4ea3773
Compare
|
Perhaps we should split out the RUF017 changes to a separate PR? And maybe find better toy examples that demonstrate the issue? On my Mac, it actually shows the opposite result for me, with 3.10: 3.12: 3.14: |
4ea3773 to
d8c9883
Compare
Maybe the list of lists was too small to see the difference? ❯ uvx python3.12 -m timeit -s 'import operator, functools; data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]*100' 'sum(data, [])'
2000 loops, best of 5: 119 usec per loop
❯ uvx python3.12 -m timeit -s 'import operator, functools; data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]*100' 'functools.reduce(operator.iadd, data, [])'
50000 loops, best of 5: 5.44 usec per loop |
d8c9883 to
dc74ac4
Compare
I'm also confused. Neither the PEP in question nor its (unmerged) implementation touches anything to do with Here's what I get building CPython with configurations ❯ ./python.exe --version
Python 3.15.0a3+
❯ ./python.exe -m timeit -s 'import operator, functools; data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]*100' 'sum(data, [])'
2000 loops, best of 5: 124 usec per loop
❯ ./python.exe -m timeit -s 'import operator, functools; data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]*100' 'functools.reduce(operator.iadd, data, [])'
50000 loops, best of 5: 6.04 usec per loop
❯ ./python.exe -m timeit -s 'import operator, functools; data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]*100' '[x for l in data for x in l]'
50000 loops, best of 5: 7.55 usec per loop
❯ ./python.exe -m timeit -s 'import operator, functools; data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]*100' '[*x for x in data]'
50000 loops, best of 5: 4.82 usec per loopSo it doesn't look like Don't we want to keep the rule but just change the autofix? |
|
Thanks for the benchmarks, @dylwil3. Looks like I misinterpreted the impact of PEP 798 on Just to confirm my understanding is correct for the next steps:
Does that cover everything? |
|
Let's split the changes to RUF017 into a separate PR, and leave this one as just adding support for 3.15. |
|
Agreed. And could you maybe add something to |
b815682 to
615ac75
Compare
615ac75 to
fddc510
Compare
target-version value in preview
Summary
Adds support for Python 3.15 to the Ruff workspace, gating it behind the
previewflag with an unstable version warning as requested.Part of #22230