def PyObject_IsSubclass(space, w_derived, w_cls): """Returns 1 if the class derived is identical to or derived from the class cls, otherwise returns 0. In case of an error, returns -1. If cls is a tuple, the check will be done against every entry in cls. The result will be 1 when at least one of the checks returns 1, otherwise it will be 0. If either derived or cls is not an actual class object (or tuple), this function uses the generic algorithm described above.""" from pypy.module.__builtin__.abstractinst import abstract_issubclass_w return abstract_issubclass_w(space, w_derived, w_cls)
def PyObject_IsSubclass(space, w_derived, w_cls): """Returns 1 if the class derived is identical to or derived from the class cls, otherwise returns 0. In case of an error, returns -1. If cls is a tuple, the check will be done against every entry in cls. The result will be 1 when at least one of the checks returns 1, otherwise it will be 0. If either derived or cls is not an actual class object (or tuple), this function uses the generic algorithm described above.""" from pypy.module.__builtin__.abstractinst import abstract_issubclass_w return abstract_issubclass_w(space, w_derived, w_cls)
def PyType_IsSubtype(space, a, b): """Return true if a is a subtype of b. """ w_type1 = from_ref(space, rffi.cast(PyObject, a)) w_type2 = from_ref(space, rffi.cast(PyObject, b)) return int(abstract_issubclass_w(space, w_type1, w_type2)) #XXX correct?
def PyType_IsSubtype(space, a, b): """Return true if a is a subtype of b. """ w_type1 = from_ref(space, rffi.cast(PyObject, a)) w_type2 = from_ref(space, rffi.cast(PyObject, b)) return int(abstract_issubclass_w(space, w_type1, w_type2)) #XXX correct?