Robert Bradshaw wrote: > On Oct 21, 2009, at 9:56 AM, Lisandro Dalcin wrote: >> OK, patch uploaded: >> http://trac.cython.org/cython_trac/attachment/ticket/417/typetest.diff >> >> Please review, and let me know if it is good enough for pushing... > > I'd either make the function inline or split it up into two functions > so that the none_allowed argument (and possibly check for none) can be > eliminated at compile time.
+1 for an inline utility function, although splitting it might still be a good idea. I'd also keep the "== Py_None" test first then, as this is something the C compiler can either know or that the CPU can quickly execute, faster than the following type check which requires at least an indirection, or even a function call (so the C compiler can't reverse the two tests due to potential side effects). Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
