[PYTHON MATRIX-SIG] First impressions from the docs

Konrad Hinsen hinsen@physik.rwth-aachen.de
Wed, 14 Aug 1996 17:24:22 +0200


   > should assume a text file with numbers and doits best to turn it into
   > an array (this is very important forreading data produced by other
   > programs). And for argumentsthat have no type/class with special
   > meaning, it should calla method toArray() if it exists.I do realize

   I completely disagree with this.  I think that reading an array from a
   text file should probably be a function that comes with the standard
   distribution, but I see NO good reason to overload the array creation
   operator with this.  There is support for something like a toArray

Consistency. If there can be a toArray() method for all objects, there should
be one for file objects too. Since it isn't possible to add methods to
C types, hard-coding this feature into the array module is the next best 
thing IMO.

   If the size remains the same, resize is exactly as efficient as
   reshape.  All of my warnings are there because I think many people will
   find resize a slightly unusual concept.  I think it needs some sort of

Well, it's in APL and in all languages derived from it, and it is
one of the most fequently used functions to form special matrices.
In fact, it would make sense to point out in the documentation that resize()
is exactly what APL calls "reshape". In APL, reshaping with a new size is 
definitely more common than reshaping with the same total size.

   dangerous bend signs around it so that novice users won't be confused. 

All it takes is an explanation of the difference...

Konrad.

-- 
-------------------------------------------------------------------------------
Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de Chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. A                | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)
-------------------------------------------------------------------------------

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

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