Strange Numeric behavior for failed assignment

Chad Netzer cnetzer at mail.arc.nasa.gov
Wed Aug 22 01:33:11 EDT 2001


I noticed the following and was wondering if it makes any sense:

Python 1.5.2 (#0, Apr 10 2001, 10:03:44)  [GCC 2.95.3 20010219 
(prerelease)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from Numeric import *
>>> a = array((0))
>>> a
0
>>> a[0]=None
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: illegal argument type for built-in operation
>>> a
-1
>>> Numeric.__version__
'17.1.2'


Should a failed assignment set the assigned value to -1?  It seems to 
me that the exception should be enough.





More information about the Python-list mailing list