<br><br><div class="gmail_quote">On Sat, Jun 21, 2008 at 7:39 AM, Travis E. Oliphant <<a href="mailto:oliphant@enthought.com">oliphant@enthought.com</a>> 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><div></div><div class="Wj3C7c">Charles R Harris wrote:<br>
> Shouldn't this raise an NotImplementedError exception?<br>
><br>
> In [7]: type(remainder(complex192(1), complex192(1)))<br>
> Out[7]: <type 'NotImplementedType'><br>
</div></div>I'm not sure if it is relevant in this case but we do need to keep in<br>
mind that Python uses the NotImplementedType as a signal to hand off the<br>
calculation to the other object in a binary operation.<br>
<br>
If we change this here we may affect that behavior, unintentionally.<br>
</blockquote><div><br>But Python only does that if the <code style="font-family: arial,sans-serif;">Py_TPFLAGS_CHECKTYPES bit in the tp_flag is set. With that flag it should try with the other variable, then raise a Type error if that fails also. That's why I think the flag isn't set for these variables; we should never see the NotImplementedType. And at first glance at the code, I don't think that flag *is* set for the type.<br>
<br>Chuck<br></code>  </div><br></div><br>