Lines Matching refs:subclass

423 _abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass)  in _abc__abc_register_impl()  argument
426 if (!PyType_Check(subclass)) { in _abc__abc_register_impl()
430 int result = PyObject_IsSubclass(subclass, self); in _abc__abc_register_impl()
432 Py_INCREF(subclass); in _abc__abc_register_impl()
433 return subclass; /* Already a subclass. */ in _abc__abc_register_impl()
440 result = PyObject_IsSubclass(self, subclass); in _abc__abc_register_impl()
453 if (_add_to_weak_set(&impl->_abc_registry, subclass) < 0) { in _abc__abc_register_impl()
462 Py_INCREF(subclass); in _abc__abc_register_impl()
463 return subclass; in _abc__abc_register_impl()
482 PyObject *subtype, *result = NULL, *subclass = NULL; in _abc__abc_instancecheck_impl() local
488 subclass = _PyObject_GetAttrId(instance, &PyId___class__); in _abc__abc_instancecheck_impl()
489 if (subclass == NULL) { in _abc__abc_instancecheck_impl()
494 int incache = _in_weak_set(impl->_abc_cache, subclass); in _abc__abc_instancecheck_impl()
504 if (subtype == subclass) { in _abc__abc_instancecheck_impl()
506 incache = _in_weak_set(impl->_abc_negative_cache, subclass); in _abc__abc_instancecheck_impl()
518 subclass, NULL); in _abc__abc_instancecheck_impl()
522 subclass, NULL); in _abc__abc_instancecheck_impl()
545 Py_XDECREF(subclass); in _abc__abc_instancecheck_impl()
553 static int subclasscheck_check_registry(_abc_data *impl, PyObject *subclass,
568 PyObject *subclass) in _abc__abc_subclasscheck_impl() argument
571 if (!PyType_Check(subclass)) { in _abc__abc_subclasscheck_impl()
585 incache = _in_weak_set(impl->_abc_cache, subclass); in _abc__abc_subclasscheck_impl()
605 incache = _in_weak_set(impl->_abc_negative_cache, subclass); in _abc__abc_subclasscheck_impl()
617 subclass, NULL); in _abc__abc_subclasscheck_impl()
623 if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) { in _abc__abc_subclasscheck_impl()
631 if (_add_to_weak_set(&impl->_abc_negative_cache, subclass) < 0) { in _abc__abc_subclasscheck_impl()
646 PyObject *mro = ((PyTypeObject *)subclass)->tp_mro; in _abc__abc_subclasscheck_impl()
652 if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) { in _abc__abc_subclasscheck_impl()
661 if (subclasscheck_check_registry(impl, subclass, &result)) { in _abc__abc_subclasscheck_impl()
678 int r = PyObject_IsSubclass(subclass, scls); in _abc__abc_subclasscheck_impl()
681 if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) { in _abc__abc_subclasscheck_impl()
693 if (_add_to_weak_set(&impl->_abc_negative_cache, subclass) < 0) { in _abc__abc_subclasscheck_impl()
707 subclasscheck_check_registry(_abc_data *impl, PyObject *subclass, in subclasscheck_check_registry() argument
711 int ret = _in_weak_set(impl->_abc_registry, subclass); in subclasscheck_check_registry()
757 int r = PyObject_IsSubclass(subclass, rkey); in subclasscheck_check_registry()
764 if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) { in subclasscheck_check_registry()