diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-02-05 20:35:29 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-02-05 20:35:29 +0000 |
commit | 85c1198c9052c6537f60f6bc629304c10dbbdd50 (patch) | |
tree | 0f7d3b8abdbe5a1ecb2d6e77245ae73a7d710028 /Include | |
parent | 6c81197a7a0ab973a0bb39652182976f21f82fb2 (diff) | |
download | cpython-85c1198c9052c6537f60f6bc629304c10dbbdd50.tar.gz |
Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
in the limited ABI
Diffstat (limited to 'Include')
-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 690f87bd32..99a7737495 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) |