[Numpy-tickets] [NumPy] #511: array does not consistently handle list with strings and Nones

NumPy numpy-tickets@scipy....
Fri May 4 12:50:05 CDT 2007


#511: array does not consistently handle list with strings and Nones
------------------------+---------------------------------------------------
 Reporter:  socha       |       Owner:  somebody                 
     Type:  defect      |      Status:  new                      
 Priority:  normal      |   Milestone:  1.0.2 Release            
Component:  numpy.core  |     Version:  none                     
 Severity:  normal      |    Keywords:  object array None strings
------------------------+---------------------------------------------------
 When creating an array from a list that has a combination of strings and
 Nones, it fails if None is not the last element, but succeeds if None is
 the last element.

 {{{
 Microsoft Windows XP [Version 5.1.2600]
 (C) Copyright 1985-2001 Microsoft Corp.

 Z:\>python
 Python 2.4.3 - Enthought Edition 1.0.0 (#69, Aug  2 2006, 12:09:59) [MSC
 v.1310
 32 bit (Intel)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy
 >>> numpy.__version__
 '1.0.2'
 >>> from numpy import array
 >>> array(['a',None])
 array([a, None], dtype=object)
 >>> array(['a',None,'b'])
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
 TypeError: expected a readable buffer object
 >>> array(['a',None,'b','c',None])
 array([a, None, b, c, None], dtype=object)
 >>>
 }}}

 -- David Socha & Daniel Terhorst [http://www.urbansim.org/ UrbanSim]

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/511>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list