[PYTHON MATRIX-SIG] Final matrix object renaming and packaging

Hinsen Konrad hinsenk@ere.umontreal.ca
Tue, 16 Jan 1996 13:52:27 -0500

   The array constructor (for PyArrayObjects):

   array([1,2,3], 'd') OR array([1,2,3], types.FloatType)

   will both produce a 1d array of doubles.


   Similarly for Arrays (and Matrix's):

   Array([1,2,3], 'd') OR Array([1.,2.,3.]) OR 
   Array([1,2,3], types.FloatType)

Also OK.

   One dilemma left is what should be used as the standard string
   representation of an Array (or an array).

   I vote for Array([1,2,3], 'd'), but I'm open to other proposals.

For the high-level arrays, I'd prefer simply Array([1,2,3])
(which is the simplest equivalent input format). For the
low-level arrays, printing the type code is probably the best

   Now, I happen to really like the old notation, and I'd love to come up
   with a way to keep it around as a shorthand input notation.  I really
   did find that the removal of a set of parenthesis made some of my
   denser code a lot easier to read.

   So, I propose to add A_d(1,2,3) as a convenient shorthand for
   Array([1,2,3], "d").  Please, let me know how terrible an idea this is.

Terrible enough for me... But do we need such abbreviations
as part of the standard modules? It would probably add to the
confusion of new users. Since it's a trivial Python definition,
without speed penalties later on, why not let everyone define
his own preferred abbreviations?

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. Centre-Ville     | 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