[PYTHON MATRIX-SIG] Type Names
Konrad HINSEN
hinsenk@ere.umontreal.ca
Thu, 8 Feb 1996 12:33:45 -0500
of measure. If you're familiar with the units it's not a problem, but
consider the task of introducing the convention to someone new to
programming. Why does the naming convention have to be obscure? To
Because we want newcomers to appreciate that we are doing something
very complicated. Isn't that the origin of most technical terms?
following question. How many gils are in a gallon? (The first
questions you need to ask of course is whether I mean an Imperial
gallon or a U.S. gallon.)
Fortunately Canada has changed to the metric system long before I
arrived here!
What do you think of the idea of explicitly naming the numeric types
to reflect the actual machine size of the number? This would make the
size of an object perfectly clear. It would also eliminate all future
I have nothing against this, but I wonder where these names would
actually be used in Python. For the array constructors, I am very
happy with the current system of "type constructors" as implemented
in Precision.py. It would be nice to have the same for output
instead of typecodes, of course, but we are not really adding all
these things as new types to Python.
While an "elegant", theoretical solution, such as Ada's ability to
declare types for numbers of any size, may be possible, an
implementation that allowed this would be slow for any size number
other than those supported directly in hardware. (With the exception
The current scheme in Precision.py of picking always the next larger
size available in hardware seems like a good compromise to me.
crunching applications. For problems where speed isn't as important
and more control over the calculation is needed then the application
could use an arbitrary length numbers class and add size constraints
as needed.
Arbitrary size floats would indeed be a nice addition to Python...
-------------------------------------------------------------------------------
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
=================