Skip to content
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

bpo-39487: Merge duplicated _Py_IDENTIFIER identifiers in C code #18254

Merged
merged 2 commits into from Jan 30, 2020

Conversation

@shihai1991
Copy link
Contributor

shihai1991 commented Jan 29, 2020

Python/import.c Outdated Show resolved Hide resolved
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 29, 2020

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@ncoghlan

This comment has been minimized.

Copy link
Contributor

ncoghlan commented Jan 29, 2020

We can't make this change, as it means the statics get initialised before the Python interpreter has been initialised, and won't be reinitialised if the interpreter is destroyed and recreated.

@ncoghlan ncoghlan closed this Jan 29, 2020
@ncoghlan ncoghlan reopened this Jan 29, 2020
@ncoghlan

This comment has been minimized.

Copy link
Contributor

ncoghlan commented Jan 29, 2020

My apologies, my comment above was based on an outdated understanding of how the identifier structs get initialised (it's the usage that initialises them, not the declaration).

That means this is a useful refactoring to help identify blockers to full subinterpreter support.

remove redundant identifier(__spec__) in import.c

Co-Authored-By: Brett Cannon <54418+brettcannon@users.noreply.github.com>
@shihai1991

This comment has been minimized.

Copy link
Contributor Author

shihai1991 commented Jan 30, 2020

I have made the requested changes; please review again

@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 30, 2020

Thanks for making the requested changes!

@brettcannon: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from brettcannon Jan 30, 2020
@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 30, 2020

Codecov Report

Merging #18254 into master will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #18254    +/-   ##
========================================
  Coverage   82.11%   82.12%            
========================================
  Files        1954     1954            
  Lines      583213   583366   +153     
  Branches    44383    44401    +18     
========================================
+ Hits       478932   479092   +160     
+ Misses      94652    94636    -16     
- Partials     9629     9638     +9     
Impacted Files Coverage Δ
Lib/test/test_distutils.py 66.66% <0.00%> (-4.77%) ⬇️
Objects/codeobject.c 82.59% <0.00%> (-1.31%) ⬇️
Modules/selectmodule.c 83.93% <0.00%> (-1.01%) ⬇️
Python/hamt.c 86.87% <0.00%> (-0.37%) ⬇️
Lib/random.py 88.12% <0.00%> (-0.28%) ⬇️
Objects/listobject.c 90.49% <0.00%> (-0.27%) ⬇️
Python/codecs.c 82.59% <0.00%> (-0.24%) ⬇️
Lib/test/test_buffer.py 95.14% <0.00%> (-0.21%) ⬇️
Python/ceval.c 88.08% <0.00%> (-0.33%) ⬇️
Objects/odictobject.c 84.36% <0.00%> (-0.15%) ⬇️
... and 37 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10355ed...98e1fb3. Read the comment docs.

@brettcannon brettcannon merged commit 46874c2 into python:master Jan 30, 2020
10 checks passed
10 checks passed
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200130.40 succeeded
Details
bedevere/issue-number Issue number 39487 found
Details
bedevere/news "skip news" label found
codecov/patch Coverage not affected when comparing 10355ed...98e1fb3
Details
codecov/project 82.12% (+0.00%) compared to 10355ed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@brettcannon

This comment has been minimized.

Copy link
Member

brettcannon commented Jan 30, 2020

Thanks, @shihai1991 !

shihai1991 added a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…honGH-18254)

Moving repetitive `_Py_IDENTIFIER` instances to a global location helps identify them more easily in regards to sub-interpreter support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.