Feature or enhancement
Proposal:
While reviewing the internal abstract protocols in pycore_abstract.h, I noticed potential areas for improving helper functions and fast-path inline checks for object protocols.
Proposed Improvement:
To enhance readability and performance for internal C-API consumers (such as shared extensions and JIT support), we can refine or add small inline utility checks similar to _PyIndex_Check:
// Example concept for checking or optimizing internal operations
static inline int
_PyIndex_Check(PyObject *obj)
{
PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number;
return (tp_as_number != NULL && tp_as_number->nb_index != NULL);
}
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Feature or enhancement
Proposal:
While reviewing the internal abstract protocols in
pycore_abstract.h, I noticed potential areas for improving helper functions and fast-path inline checks for object protocols.Proposed Improvement:
To enhance readability and performance for internal C-API consumers (such as shared extensions and JIT support), we can refine or add small inline utility checks similar to
_PyIndex_Check:Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs