[Numpy-tickets] [NumPy] #1005: numpy not working with itertools.chain objects

NumPy numpy-tickets@scipy....
Wed Feb 11 16:12:36 CST 2009

#1005: numpy not working with itertools.chain objects
 Reporter:  rogerbrent  |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:  1.3.0   
Component:  numpy.core  |     Version:  none    
 Severity:  normal      |    Keywords:          
 numpy.array(), numpy.sum(), etc. don't seem to work with itertools.chain


 from itertools import chain

 iter = chain(xrange(5))


 returns array(<itertools.chain object at 0x0172C828>, dtype=object).
 list(iter) would work as expected, returning [0, 1, 2, 3, 4].

 However if I define my own chain() function then array(iter) works fine.

 Python v2.5.4 and numpy v1.2.1

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

More information about the Numpy-tickets mailing list