-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,13 +70,10 @@ the definition of all other Python objects. | |
| (((PyObject*)(o))->ob_type) | ||
|
|
||
|
|
||
| .. c:macro:: Py_IS_TYPE(o, type) | ||
|
|
||
| This macro is used to check whether the type of object *o* is the *type*. | ||
| It expands to:: | ||
|
|
||
| (Py_TYPE(o) == type) | ||
| .. 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. | ||
|
corona10 marked this conversation as resolved.
Outdated
|
||
|
|
||
| .. versionadded:: 3.9 | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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."
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh sure :)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ;-)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it ;-)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| Add :c:macro:`Py_IS_TYPE` macro to check whether the type of object *o* is | ||
| the *type*. | ||
| Add :c:func:`Py_IS_TYPE` static inline function to check whether | ||
|
corona10 marked this conversation as resolved.
Outdated
|
||
| the type of object *o* is the *type*. | ||
|
corona10 marked this conversation as resolved.
Outdated
|
||


Uh oh!
There was an error while loading. Please reload this page.