hpy icon indicating copy to clipboard operation
hpy copied to clipboard

Add HPy<type>_Check for all fast equivalent type checks in CPython.

Open fangerer opened this issue 2 years ago • 1 comments

There are some very fast Py<type>_Check functions in CPython that just do masking on the type flags (see https://github.com/python/cpython/blob/d460c8ec52716a37080d31fdc0f673edcc98bee8/Include/object.h#L433). HPy has a hard time to compete with that if we don't have dedicated functions that can be mapped to those in CPython ABI mode. We could still have a slightly different API that would then internally use those functions. OTOH, the migration path would be easier if we just introduce similar type checking functions.

fangerer avatar Dec 01 '22 08:12 fangerer