[PYTHON MATRIX-SIG] Type naming conventions

Hinsen Konrad hinsenk@ere.umontreal.ca
Fri, 26 Jan 1996 12:05:45 -0500


   I'd like to propose adding the following functions to Numeric.py.

   Character
   Integer
   Float
   Complex

I like the idea, but would prefer names like CharacterType, IntType etc.
"Integer" looks too much like a cast to integer type.

   Things like Integer(minimumSize=16) would also be possible if we
   agreed they made sense.  You'd also want to have Integer() just return
   the typecode used by python ints.

The latter makes more sense to me.

To be precise, I'd like these functions to return a typecode for a
type that is at least as big as indicated, not necessarily exactly as
big. For integers this is not so important (the sizes are always
8/16/32/64 on modern machines), but there is more variation for float
types. In fact the FloatType() function should perhaps have two
arguments, one specifying precision and the other range. Then
FloatType(10, 50) would specify a type with an accuracy of 10 or more
decimal digits and a range of at least 10**50 (which would be "double"
on most machines, but "float" on a Cray).

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