-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
cProfile with list comprehension is less obvious with Python 3.12 #107088
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
Comments
I'm sorry, I didn't catch this. https://peps.python.org/pep-0709/#tracing-profiling-will-no-longer-show-a-call-return-for-the-comprehension
|
Don't be sorry — it's our job to call out backwards-incompatible changes in the docs!
It already has a bullet point in the PEP-709 section of "What's New in Python 3.12". Hmm, not sure how we could document this anymore thoroughly than we already have. Unless we put a note in the cProfile docs as well? Not sure where that would go, though. |
Since this is already called out in PEP-709, and in "What's New in Python 3.12", I don't think there's any way we can further improve the docs here :/
On the plus side, list comprehensions should also be much faster in Python 3.12 as a result of this change :-) |
Yup, yup. This makes sense. I was looking for a change in cProfile in 3.12, not with the comprehensions. Thank you @AlexWaygood! |
Bug report
I believe that the cProfiler is less helpful now in python 3.12 when attempting to point a developer to a list comprehension as the bottleneck. With python 3.11, it points out that there is a
listcomp
that is responsible for the bulk of the duration. In 3.12, that line is missing.Python 3.11.4
Python 3.12.0b4
Your environment
The text was updated successfully, but these errors were encountered: