8000 bpo-39573: Add Py_IS_TYPE macro by corona10 · Pull Request #18488 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-39573: Add Py_IS_TYPE macro #18488

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 4 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
bpo-39573: Apply code review
  • Loading branch information
corona10 committed Feb 13, 2020
commit e49cc8933b9fbb0ad2735166d215fdb5fc54135b
4 changes: 2 additions & 2 deletions Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ the definition of all other Python objects.

.. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)

Return true if the type of object *o* is the *type*.
Equivalent to: Py_TYPE(o) == type.
Return non-zero if the object *o* type is *type*. Return zero otherwise.
Equivalent to: ``Py_TYPE(o) == type``.

.. versionadded:: 3.9

Copy link
Member

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

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

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

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

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Add :c:func:`Py_IS_TYPE` static inline function to check whether
the type of object *o* is the *type*.
Add :c:func:`Py_IS_TYPE` static inline function to check
whether the object *o* type is *type*.
0