numpy/numpy — pull request #5056 by juliantaylor (2014-09-07 12:57:36+00:00)
Title: add C-API PyArray_IsAnyScalarExact

PyArray_IsAnyScalarExact checks if an object is exactly any numpy scalar, this allows skipping some costly attribute lookups like `__array_priority__` and `__numpy_ufunc__`.

this improves the array_scalar * numpy_scalar performance issue seen in gh-5030