<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">&lt;<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>&gt;</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>
&gt; In most cases I&#39;m checking for whatever is generated by cdef class Foo:<br>
&gt; ... I&#39;m not sure if that would be a type or a subclass.<br>
<br>
</div>It&#39;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&#39;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>