bpo-39573: Add Py_IS_TYPE macro by corona10 · Pull Request #18488 · python/cpython

@corona10

vstinner

Choose a reason for hiding this comment

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

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.

@corona10

@codecov

@corona10 corona10 changed the title bpo-39573: Add Py_IS_TYPE macro [WIP] bpo-39573: Add Py_IS_TYPE macro

Feb 12, 2020

@corona10

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

Choose a reason for hiding this comment

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

vstinner

@corona10

@corona10

vstinner

Equivalent to: Py_TYPE(o) == type.

.. versionadded:: 3.9

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Oh sure :)

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

Choose a reason for hiding this comment

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

Got it ;-)

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

@vstinner

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