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-39573: Add Py_IS_TYPE macro #18488

Merged
merged 4 commits into from Feb 13, 2020
Merged

bpo-39573: Add Py_IS_TYPE macro #18488

merged 4 commits into from Feb 13, 2020

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Feb 12, 2020

Copy link
Member

@vstinner vstinner left a comment

I suggest to modify Argument Clinic in a separated PR, but use this PR to update PyXXX_CheckExact() macros. See: nascheme@c156300

You should credit Neil if you reuse his commit: add Author: Neil Schemenauer <nas-github@arctrix.com> at the end of your commit message.

Include/object.h Outdated Show resolved Hide resolved
Doc/c-api/structures.rst Outdated Show resolved Hide resolved
@codecov
Copy link

@codecov codecov bot commented Feb 12, 2020

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #18488       +/-   ##
===========================================
+ Coverage   82.11%   83.19%    +1.08%     
===========================================
  Files        1956     1571      -385     
  Lines      589145   414668   -174477     
  Branches    44447    44450        +3     
===========================================
- Hits       483801   345002   -138799     
+ Misses      95697    60016    -35681     
- Partials     9647     9650        +3     
Impacted Files Coverage Δ
Lib/distutils/tests/test_bdist_rpm.py 30.00% <0.00%> (-65.00%) ⬇️
Lib/distutils/command/bdist_rpm.py 7.63% <0.00%> (-56.88%) ⬇️
Lib/test/test_urllib2net.py 76.92% <0.00%> (-13.85%) ⬇️
Lib/test/test_smtpnet.py 78.57% <0.00%> (-7.15%) ⬇️
Lib/ftplib.py 63.85% <0.00%> (-6.06%) ⬇️
Lib/test/test_ftplib.py 87.11% <0.00%> (-4.72%) ⬇️
Tools/scripts/db2pickle.py 17.82% <0.00%> (-3.97%) ⬇️
Tools/scripts/pickle2db.py 16.98% <0.00%> (-3.78%) ⬇️
Lib/test/test_socket.py 71.94% <0.00%> (-3.77%) ⬇️
Lib/test/test_asyncio/test_base_events.py 91.84% <0.00%> (-3.30%) ⬇️
... and 439 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 4fac7ed...e49cc89. Read the comment docs.

@corona10 corona10 changed the title bpo-39573: Add Py_IS_TYPE macro [WIP] bpo-39573: Add Py_IS_TYPE macro Feb 12, 2020
@corona10 corona10 requested review from 1st1, abalkin and pganssle as code owners Feb 12, 2020
Co-Author: Neil Schemenauer <nas-github@arctrix.com>
@corona10 corona10 changed the title [WIP] bpo-39573: Add Py_IS_TYPE macro bpo-39573: Add Py_IS_TYPE macro Feb 12, 2020
@corona10 corona10 requested a review from vstinner Feb 12, 2020
Copy link
Member Author

@corona10 corona10 left a comment

@vstinner I've updated the PR :)

Doc/c-api/structures.rst Outdated Show resolved Hide resolved
Doc/c-api/structures.rst Outdated Show resolved Hide resolved
@corona10
Copy link
Member Author

@corona10 corona10 commented Feb 13, 2020

@vstinner Updated! Thanks for the review

@corona10 corona10 requested a review from vstinner Feb 13, 2020
Doc/c-api/structures.rst Outdated Show resolved Hide resolved
Doc/c-api/structures.rst Outdated Show resolved Hide resolved
Equivalent to: Py_TYPE(o) == type.

.. versionadded:: 3.9

Copy link
Member

@vstinner vstinner Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, I noticed a typo in one of my previous commit. Would you mind to take this PR as an opportunity to fix it?

https://docs.python.org/dev/c-api/structures.html#c.Py_SET_SIZE

"Set the object o size of size." => "Set ... to size."

Copy link
Member Author

@corona10 corona10 Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sure :)

Copy link
Member

@vstinner vstinner Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, @brandtbucher wrote PR #18496. I will ask him to fix the typo there. You can ignore this special request ;-)

Copy link
Member Author

@corona10 corona10 Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it ;-)

Copy link
Member Author

@corona10 corona10 Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current

스크린샷 2020-02-13 오후 11 23 37

Suggestion

스크린샷 2020-02-13 오후 11 15 15

Looks like not work as we want ;)

@corona10 corona10 requested a review from vstinner Feb 13, 2020
@corona10
Copy link
Member Author

@corona10 corona10 commented Feb 13, 2020

@vstinner Updated :)

@vstinner vstinner merged commit d905df7 into python:master Feb 13, 2020
11 checks passed
@vstinner
Copy link
Member

@vstinner vstinner commented Feb 13, 2020

Thanks, merged. You can now redo your Argument Clinic change on top of it.

chrisburr pushed a commit to chrisburr/cpython that referenced this issue Dec 9, 2020
Co-Author: Neil Schemenauer <nas-github@arctrix.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants