GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-39573: Finish converting to new Py_IS_TYPE macro. by petdance · Pull Request #18601 · python/cpython

Conversation

@petdance

@petdance petdance commented Feb 22, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@petdance
Finish converting to new Py_IS_TYPE macro.
7a1ab0f
@petdance
petdance requested review from 1st1, asvetlov, brettcannon, encukou, ericsnowcurrently, ncoghlan, rhettinger and warsaw as code owners February 22, 2020 04:44
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 22, 2020
@bedevere-bot bedevere-bot added the awaiting review label Feb 22, 2020
@codecov

codecov Bot 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 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Mar 3, 2020
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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 :-)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Include/py_curses.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_io/bufferedio.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_io/bufferedio.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/itertoolsmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/descrobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/genobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/genobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_io/bufferedio.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

petdance and others added 8 commits March 3, 2020 17:18
@petdance @vstinner
Update Include/py_curses.h
2128eee
Co-Authored-By: Victor Stinner <[email protected]>
@petdance @vstinner
Update Modules/_io/bufferedio.c
2b6b769
Co-Authored-By: Victor Stinner <[email protected]>
@petdance @vstinner
Update Objects/genobject.c
0c6f3a7
Co-Authored-By: Victor Stinner <[email protected]>
@petdance @vstinner
Update Modules/_io/bufferedio.c
2aec9de
Co-Authored-By: Victor Stinner <[email protected]>
@petdance @vstinner
Update Modules/itertoolsmodule.c
8350cc7
Co-Authored-By: Victor Stinner <[email protected]>
@petdance @vstinner
Update Modules/_io/bufferedio.c
f74379c
Co-Authored-By: Victor Stinner <[email protected]>
@petdance @vstinner
Update Objects/descrobject.c
9ba0ae5
Co-Authored-By: Victor Stinner <[email protected]>
@petdance @vstinner
Update Objects/genobject.c
876e192
Co-Authored-By: Victor Stinner <[email protected]>
@vstinner vstinner added the skip news label Mar 4, 2020
@vstinner
vstinner merged commit dffe4c0 into python:master Mar 4, 2020
@bedevere-bot bedevere-bot removed the awaiting review label Mar 4, 2020
@vstinner

vstinner commented Mar 4, 2020

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sthagen added a commit to sthagen/python-cpython that referenced this pull request Mar 4, 2020
@sthagen
Merge pull request #300 from python/master
4387e74
bpo-39573: Finish converting to new Py_IS_TYPE() macro (pythonGH-18601)
@petdance

petdance commented Mar 4, 2020

Copy link
Copy Markdown
Contributor Author

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

Sure, I'll take care of them.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@petdance

petdance commented Mar 5, 2020

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@petdance
petdance deleted the bpo-39573 branch March 6, 2020 06:04
@vstinner vstinner mentioned this pull request Mar 12, 2024
[C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type #83754
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments
@1st1 1st1 Awaiting requested review from 1st1
@asvetlov asvetlov Awaiting requested review from asvetlov
@brettcannon brettcannon Awaiting requested review from brettcannon
@encukou encukou Awaiting requested review from encukou
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently
@ncoghlan ncoghlan Awaiting requested review from ncoghlan
@rhettinger rhettinger Awaiting requested review from rhettinger
@warsaw warsaw Awaiting requested review from warsaw

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@petdance @vstinner @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.