OK, here's a patch for:
#718: Bug with numpy.float32.tolist

Can someone commit it (I hope someone has committed the other patches
i've sent)?

James
--- arrayobject.c.old	2008-04-06 13:08:37.000000000 +0100
+++ arrayobject.c	2008-04-06 13:10:57.000000000 +0100
@@ -1870,8 +1870,11 @@
 
     if (!PyArray_Check(self)) return (PyObject *)self;
 
-    if (self->nd == 0)
-        return self->descr->f->getitem(self->data,self);
+    if (self->nd == 0) {
+        lp = PyList_New(1);
+        PyList_SetItem(lp, 0, self->descr->f->getitem(self->data, self));
+        return lp;
+    }
 
     sz = self->dimensions[0];
     lp = PyList_New(sz);
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to