Usage of NotImplemented in Numexpr

Ivan Vilata i Balaguer ivilata at carabos.com
Mon Oct 16 12:36:49 EDT 2006


En/na Tim Hochberg ha escrit::

> Ivan Vilata i Balaguer wrote:
>>
>>     for i, x in enumerate(args):
>>         if isConstant(x):
>>             args[i] = ConstantNode(x)
>>         elif not isinstance(x, ExpressionNode):
>>             raise TypeError( "unsupported object type: %s",
>>                              type(x) )
>>
>> Do you think this is OK, or am I wrong or missing something?
> 
> That looks right. I'm not entirely happy with this fix; I believe that 
> returning NotImplemented was intentional with the idea that we might 
> someday want to use the NotImplemented machinery. That said, I can't 
> think of a better fix and I don't see us using the NotImplemented 
> machinery anytime soon, so I imagine it should go in.

Maybe placing a comment there should be enough for future reference.  By
the way, I noticed that I splipped a bad string interpolation there, it
should be ``"unsupported object type: %s" % type(x)``.

Cheers,

::

	Ivan Vilata i Balaguer   >qo<   http://www.carabos.com/
	       Cárabos Coop. V.  V  V   Enjoy Data
	                          ""

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 309 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20061016/58e51ef5/attachment.sig>
-------------- next part --------------
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------- next part --------------
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


More information about the NumPy-Discussion mailing list