<div dir="ltr">So how do I go about getting PyObject_TypeCheck working?<br><br>-Aaron<br><br><div class="gmail_quote">On Mon, Sep 22, 2008 at 4:30 PM, Greg Ewing <span dir="ltr"><<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">Aaron DeVore wrote:<br>
<br>
> In most cases I'm checking for whatever is generated by cdef class Foo:<br>
> ... I'm not sure if that would be a type or a subclass.<br>
<br>
</div>It's a type, aka new-style class, so both PyObject_TypeCheck<br>
and PyObject_IsInstance will work equally well, and they<br>
will both accept either that exact type or a subclass of<br>
it.<br>
<br>
PyObject_TypeCheck is probably a bit faster, since it doesn't<br>
have to worry about dealing with old-style classes and<br>
instances.<br>
<br>
--<br>
<font color="#888888">Greg<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Cython-dev mailing list<br>
<a href="mailto:Cython-dev@codespeak.net">Cython-dev@codespeak.net</a><br>
<a href="http://codespeak.net/mailman/listinfo/cython-dev" target="_blank">http://codespeak.net/mailman/listinfo/cython-dev</a><br>
</div></div></blockquote></div><br></div>