GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-126072: do not add `None` to `co_consts` if no docstring by xuantengh · Pull Request #126101 · python/cpython Conversation
|
| co_flags bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg | |
| | 16=nested | 32=generator | 64=nofree | 128=coroutine | |
| | 256=iterable_coroutine | 512=async_generator |
I've also updated the related documentation, but maybe there is something I missed. Please help me improve this PR, thank you!
📚 Documentation preview 📚: https://cpython-previews--126101.org.readthedocs.build/
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please add some tests, probably to test_code.py.
You'll also probably need to change the __doc__ descriptor on function objects so it continues to work correctly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Maybe the optimization pass should be updated as the hypothesis may not hold: Lines 2117 to 2119 in 9b14083
The generated bytecodes for the same function are different before and after this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
FYI, we are in the process of removing small ints from the Can you change the ints in your tests to strings. Doing so will also help test that non-docstring strings do not get interpreted as docstrings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There are a few improvements we can make to the bytecode compiler once this PR is done. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yeah, what I concern is whether the constant removal optimization will lead to a unexpected results when the first element in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Currently, as the const removal optimization unconditionally keeps the first element in consts, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One small edit for the language reference.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this.
This was one of those little things that's been bothering me for a while.
Glad to see it fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Update doc |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
One small comment on inspect.rst.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The UI shows 2 jobs still in progress. But they have completed successfully 🤷♂️ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for your review, it's my first PR merged into CPython! And I'm also interested in the following related optimizations. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Congratulations! in your next PR, add your name to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.