mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Move the code implementing isinstance() and issubclass() to new C
APIs, PyObject_IsInstance() and PyObject_IsSubclass() -- both returning an int, or -1 for errors.
This commit is contained in:
parent
91751143eb
commit
823649d544
3 changed files with 125 additions and 96 deletions
|
@ -1074,6 +1074,13 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
|
|||
*/
|
||||
|
||||
|
||||
DL_IMPORT(int) PyObject_IsInstance(PyObject *object, PyObject *typeorclass);
|
||||
/* isinstance(object, typeorclass) */
|
||||
|
||||
DL_IMPORT(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);
|
||||
/* issubclass(object, typeorclass) */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue