[PYTHON MATRIX-SIG] Renaming and Constructors

Hinsen Konrad hinsenk@ere.umontreal.ca
Thu, 7 Dec 1995 15:14:31 -0500


   Does a FloatMatrix contain C floats or doubles (both are possible in  
   matrices)?  Please define a complete naming scheme that can be compared to  

Really? I didn't know that. Anyway, "float" should mean what it means
in normal Python, i.e. C double. C floats could be called
"ShortFloat", for example.

As for the other typecodes, I am not sure what they all mean (is
there a list somewhere?). But let's start:

'c'  Character
'u'  Unsigned  (is that really useful?)
'1'  ??? (maybe Boolean?)
's'  String
'i'  Integer
'l'  LongInteger
'f'  ShortFloat
'd'  Float
'F'  ??? (maybe ShortComplex?)
'D'  Complex
'O'  General

   The only problem that I have with array is that python already has arrays  
   with a known semantics.  The fundamental rule in python is to never break  
   existing code.  I know this is annoying, but the only other option would be  
   to make the current matrices completely backward compatible with the  
   existing arrays.  (Which is possibly possible...)

So that means we can not call any module "array", but we can still
use the name "array" within the modules. A suggestions:
- "arrays_and_matrices" for the C module that nobody imports
  directly anyway.
- "Array" for the Python wrapper with array semantics; "Array"
  in the names of the constructors.
- "Matrix" for the Python wrapper with 2D-matrix semantics; "Matrix"
  in the names of the constructors.
That leaves the possibility of confusion between "array" and "Array",
but I can live with that. I doubt the current Python arrays will
be attractive to anyone who has the new module.

   namespace.  This namespace issue is an important one.  I really don't think  
   that we are going to be adding any of the three of these to the python core  
   any time soon.

They don't have to be. They just have to be in the namespace of
the modules "Array" and "Matrix".

   > I guess that's enough for today ;-) I wish the lucky participants
   > of the workshop much fun and hope that they don't have to eat
   > spam for lunch ;-)

   Had much fun, never ate SPAM - Jim

That's cheating ;-)

-------------------------------------------------------------------------------
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
=================