On 2018-09-12, Stefan Behnel wrote:
So, if the goal is to make this common operation slow, what alternative do you envison for getting back an "almost no cost" type check?
Off the top of my head, I think you can have a C99 inline function, like Py_IsType(ob, tp). If you build with tagged pointers turned off, there is no cost compared to what we currently do. If you turn them on, there is an extra check on the low bits of the pointer and a branch. Not sure that qualifies as "almost no cost" but seems not bad to me.
Neil