diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-02-05 20:35:29 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-02-05 20:35:29 (GMT) |
commit | 738236dbd62aab5f0cf27f9ba0f2de3cb65802d2 (patch) | |
tree | b531bab8d3e4272e931f74297c988f9b26f71f9e /Include/object.h | |
parent | 9b142aaae8581cc436c5a822bfac57e1687f6743 (diff) | |
download | cpython-738236dbd62aab5f0cf27f9ba0f2de3cb65802d2.zip cpython-738236dbd62aab5f0cf27f9ba0f2de3cb65802d2.tar.gz cpython-738236dbd62aab5f0cf27f9ba0f2de3cb65802d2.tar.bz2 |
Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
in the limited ABI
Diffstat (limited to 'Include/object.h')
-rw-r--r-- | Include/object.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h index 690f87b..99a7737 100644 --- a/Include/object.h +++ b/Include/object.h @@ -437,6 +437,8 @@ PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */ PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */ PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */ +PyAPI_FUNC(long) PyType_GetFlags(PyTypeObject*); + #define PyType_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS) #define PyType_CheckExact(op) (Py_TYPE(op) == &PyType_Type) @@ -589,7 +591,11 @@ given type object has a specified feature. Py_TPFLAGS_HAVE_VERSION_TAG | \ 0) +#ifdef Py_LIMITED_API +#define PyType_HasFeature(t,f) ((PyType_GetFlags(t) & (f)) != 0) +#else #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) +#endif #define PyType_FastSubclass(t,f) PyType_HasFeature(t,f) |