Pierre GM wrote: > On Monday 10 July 2006 05:57, Robert Kern wrote: >> Nils Wagner wrote: >>> Hi all, >>> >>> I have a list consisting of arrays of different size > ... >> The error message is unhelpful, certainly, but the *fact* that an exception >> is raised is not a bug. > > Attempting to build an array from a list of sequences with different sizes > seem to be a rather common mistake (judging from the recurrence of the topic > on that list). > As Robert pointed, the current error message is not helpful. > Could it be possible to change it ? A "(inconsistent sizes ?)" could at least > be added...
People have looked at this before. IIRC, the conclusion was that at the specific place where the exception needs to be raised, the information that it came from a "ragged" input is lost, and that exception can be raised in other circumstances as well (so it can't just be reworded). The number of cases that array() tries to handle automatically is quite large, and that makes for hairy code. OTOH, if you can pinpoint a place where we can raise a more specific exception without changing the semantics of the function, I'd be happy to apply your patch. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco ------------------------------------------------------------------------- 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 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion