On Mon, Sep 22, 2008 at 1:46 AM, Christian Heimes <[EMAIL PROTECTED]> wrote:

> Do you want to check for builtin types like PyString, PyUnicode etc. or
> subclasses? Python has super fast checks for builtin types, for example
> PyString_Check(obj) or PyString_CheckExact(obj).
>
> PyObject_TypeCheck is a macro while PyObject_IsInstance is a recursive
> function that does much more work than PyObject_TypeCheck. Therefore
> PyObject_TypeCheck should be a bit faster than PyObject_IsInstance. By
> the way the latter is invoked by isinstance(), too.
>
> Christian

In most cases I'm checking for whatever is generated by cdef class Foo: ...
I'm not sure if that would be a type or a subclass. There are a few places
where I am do checks for dict, str, unicode, and list. I have absolutely no
idea how that would affect things, though.

-Aaron
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to