[PYTHON MATRIX-SIG] Re: empty array

James Hugunin jjh@Goldilocks.LCS.MIT.EDU
Mon, 25 Mar 96 14:35:52 EST


   From: hinsenk@ere.umontreal.ca (Konrad HINSEN)

   >  
   >         > array() should accept empty lists in its arguments. Then array([])
   >         > would be a rank-1 array of length zero, array([[],[]]) a rank-2 array
   >         > of shape (2,0) and so on. 
   > 
   > That is what I expected, too, but it does not work, at least on my 
   > system (built from v0.35). What is wrong in this code?

   I know it doesn't work. When I wrote "it should work" I didn't mean
   "I think it works", but "I think it ought to work". Keep in mind
   that the array module is neither finished nor bug-free.

I made the obvious patches to get this to work and noticed that
array([]) creates an empty array of characters (This is the lowest
type in the type hierarchy).  This is probably not what people want in
the general case.  Any suggestions on how to deal with the type of an
empty array?

-Jim

BTW - I'm making these patches in preparation for one a final 0.36
release containing a fairly large number of bug fixes.  After that I
plan to start work on v0.40 which will involve switching over to much
of Konrad's proposed naming conventions.



=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================