[PYTHON MATRIX-SIG] Type coercion two more times
Hinsen Konrad
hinsenk@ere.umontreal.ca
Fri, 26 Jan 1996 09:54:08 -0500
I'm about 12 hours behind all of you in North America, so I come to
work in the morning and read all the activity of the previous
On the contrary, you are 14 hours ahead of us (us on the East coast
at least), so you could complete a whole discussion ready for
us every morning ;-)
- Coercions within a Class (Integer<->Integer,Float<->Float) are
governed by this attribute, namely,
If this attribute exists and is TRUE:
then the result will be the same type as the multiarray.
If the attribute does not exists or is FALSE,
then NORMAL Python coercion rules apply, and
the result will always be a PyInteger, PyFloat, or PyComplex.
Basically that means having two array types with different behaviour,
and hiding that distinction in an attribute. Which means most users
won't be aware of its existence and will be surprised the first time
they get something else than they expect.
Besides, it doesn't solve Jim's problem of mixing C float arrays with
Python float scalars. If you consider scalars to be of "coercible"
type, then you run into the same problem as with Jim's second
proposal. If not, then the problem is the same as with full automatic
coercion.
-------------------------------------------------------------------------------
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
=================