Skip to content

bpo-39573: Finish converting to new Py_IS_TYPE macro. #18601

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

Merged
merged 9 commits into from
Mar 4, 2020
Merged

bpo-39573: Finish converting to new Py_IS_TYPE macro. #18601

merged 9 commits into from
Mar 4, 2020

Conversation

petdance
Copy link
Contributor

@petdance petdance commented Feb 22, 2020

Updates remaining files to use Py_IS_TYPE:

 Include/py_curses.h                |  2 +-
 Modules/_asynciomodule.c           |  2 +-
 Modules/_collectionsmodule.c       |  2 +-
 Modules/_elementtree.c             |  2 +-
 Modules/_io/bufferedio.c           | 12 ++++++------
 Modules/_io/stringio.c             |  2 +-
 Modules/_io/textio.c               | 16 ++++++++--------
 Modules/_pickle.c                  |  4 ++--
 Modules/_threadmodule.c            |  4 ++--
 Modules/cjkcodecs/multibytecodec.h |  2 +-
 Modules/itertoolsmodule.c          |  2 +-
 Objects/abstract.c                 |  2 +-
 Objects/descrobject.c              |  4 ++--
 Objects/exceptions.c               |  4 ++--
 Objects/genobject.c                |  6 +++---
 Objects/listobject.c               | 22 +++++++++++-----------
 Objects/namespaceobject.c          |  2 +-
 Objects/tupleobject.c              |  2 +-
 Objects/typeobject.c               |  8 ++++----
 Objects/unicodeobject.c            |  4 ++--
 Python/ceval.c                     |  4 ++--
 Python/errors.c                    |  2 +-
 Python/importdl.c                  |  2 +-

https://bugs.python.org/issue39573

@codecov
Copy link

codecov bot commented Feb 22, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #18601   +/-   ##
=======================================
  Coverage   82.06%   82.06%           
=======================================
  Files        1955     1955           
  Lines      584068   584068           
  Branches    44458    44458           
=======================================
+ Hits       479334   479335    +1     
+ Misses      95110    95107    -3     
- Partials     9624     9626    +2     
Impacted Files Coverage Δ
Lib/idlelib/runscript.py 19.23% <0.00%> (-1.54%) ⬇️
Modules/binascii.c 85.86% <0.00%> (-0.91%) ⬇️
Lib/test/test_asyncio/functional.py 70.27% <0.00%> (-0.55%) ⬇️
Modules/_xxtestfuzz/fuzzer.c 72.86% <0.00%> (-0.51%) ⬇️
Modules/_struct.c 89.13% <0.00%> (-0.44%) ⬇️
Lib/test/test_random.py 96.78% <0.00%> (-0.31%) ⬇️
Lib/random.py 88.12% <0.00%> (-0.28%) ⬇️
Lib/test/test_io.py 94.86% <0.00%> (+0.03%) ⬆️
Modules/socketmodule.c 75.78% <0.00%> (+0.08%) ⬆️
Programs/_testembed.c 89.55% <0.00%> (+0.12%) ⬆️
... and 3 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 a025d4c...7a1ab0f. Read the comment docs.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

First round of review: the parenthesis review :-)

petdance and others added 8 commits March 3, 2020 17:18
Co-Authored-By: Victor Stinner <[email protected]>
Co-Authored-By: Victor Stinner <[email protected]>
Co-Authored-By: Victor Stinner <[email protected]>
Co-Authored-By: Victor Stinner <[email protected]>
Co-Authored-By: Victor Stinner <[email protected]>
Co-Authored-By: Victor Stinner <[email protected]>
Co-Authored-By: Victor Stinner <[email protected]>
@vstinner vstinner merged commit dffe4c0 into python:master Mar 4, 2020
@vstinner
Copy link
Member

vstinner commented Mar 4, 2020

@petdance: Thanks, merged. There are code like (Py_TYPE(other) != &keyobject_type). Do you want to convert them to !Py_IS_TYPE(obj, type) as well?

sthagen added a commit to sthagen/python-cpython that referenced this pull request Mar 4, 2020
bpo-39573: Finish converting to new Py_IS_TYPE() macro (pythonGH-18601)
@petdance
Copy link
Contributor Author

petdance commented Mar 4, 2020

Do you want to convert them to !Py_IS_TYPE(obj, type) as well?

Sure, I'll take care of them.

@petdance
Copy link
Contributor Author

petdance commented Mar 5, 2020

@vstinner I've updated the negated checks to use Py_IS_TYPE as well over at #18789.

@petdance petdance deleted the bpo-39573 branch March 6, 2020 06:04
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.

4 participants