Skip to content

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

Merged
vstinner merged 9 commits into
python:masterfrom
petdance:bpo-39573
Mar 4, 2020
Merged

bpo-39573: Finish converting to new Py_IS_TYPE macro.#18601
vstinner merged 9 commits into
python:masterfrom
petdance:bpo-39573

Conversation

@petdance

@petdancepetdance commented Feb 22, 2020

Copy link
Copy Markdown
Contributor

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

codecovBot commented Feb 22, 2020

Copy link
Copy Markdown

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 FilesCoverage Δ
Lib/idlelib/runscript.py19.23% <0.00%> (-1.54%)⬇️
Modules/binascii.c85.86% <0.00%> (-0.91%)⬇️
Lib/test/test_asyncio/functional.py70.27% <0.00%> (-0.55%)⬇️
Modules/_xxtestfuzz/fuzzer.c72.86% <0.00%> (-0.51%)⬇️
Modules/_struct.c89.13% <0.00%> (-0.44%)⬇️
Lib/test/test_random.py96.78% <0.00%> (-0.31%)⬇️
Lib/random.py88.12% <0.00%> (-0.28%)⬇️
Lib/test/test_io.py94.86% <0.00%> (+0.03%)⬆️
Modules/socketmodule.c75.78% <0.00%> (+0.08%)⬆️
Programs/_testembed.c89.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.

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

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 :-)

Comment threadInclude/py_curses.h Outdated
Comment threadModules/_io/bufferedio.c Outdated
Comment threadModules/_io/bufferedio.c Outdated
Comment threadModules/itertoolsmodule.c Outdated
Comment threadObjects/descrobject.c Outdated
Comment threadObjects/genobject.c Outdated
Comment threadObjects/genobject.c Outdated
Comment threadModules/_io/bufferedio.c Outdated
petdanceand others added 8 commits March 3, 2020 17:18
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-Authored-By: Victor Stinner <vstinner@python.org>
@vstinner
vstinner merged commit dffe4c0 into python:masterMar 4, 2020
@vstinner

Copy link
Copy Markdown
Member

@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
Copy Markdown
ContributorAuthor

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

Sure, I'll take care of them.

@petdance

Copy link
Copy Markdown
ContributorAuthor

@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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@petdance@vstinner@the-knights-who-say-ni@bedevere-bot