diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2020-02-13 17:37:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 17:37:17 (GMT) |
commit | d905df766c367c350f20c46ccd99d4da19ed57d8 (patch) | |
tree | 9e08a6c88d6b0dd4e73810c3f3a152b61bd773aa /Include/datetime.h | |
parent | 968dcd9e7a4d3aa9aaa1dfca693adf60d6b71ce7 (diff) | |
download | cpython-d905df766c367c350f20c46ccd99d4da19ed57d8.zip cpython-d905df766c367c350f20c46ccd99d4da19ed57d8.tar.gz cpython-d905df766c367c350f20c46ccd99d4da19ed57d8.tar.bz2 |
bpo-39573: Add Py_IS_TYPE() function (GH-18488)
Co-Author: Neil Schemenauer <nas-github@arctrix.com>
Diffstat (limited to 'Include/datetime.h')
-rw-r--r-- | Include/datetime.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Include/datetime.h b/Include/datetime.h index 00507cb..5d9f255 100644 --- a/Include/datetime.h +++ b/Include/datetime.h @@ -196,19 +196,19 @@ static PyDateTime_CAPI *PyDateTimeAPI = NULL; /* Macros for type checking when not building the Python core. */ #define PyDate_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateType) -#define PyDate_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateType) +#define PyDate_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->DateType) #define PyDateTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateTimeType) -#define PyDateTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateTimeType) +#define PyDateTime_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->DateTimeType) #define PyTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TimeType) -#define PyTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TimeType) +#define PyTime_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->TimeType) #define PyDelta_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DeltaType) -#define PyDelta_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DeltaType) +#define PyDelta_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->DeltaType) #define PyTZInfo_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TZInfoType) -#define PyTZInfo_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TZInfoType) +#define PyTZInfo_CheckExact(op) Py_IS_TYPE(op, PyDateTimeAPI->TZInfoType) /* Macros for accessing constructors in a simplified fashion. */ |