[PYTHON MATRIX-SIG] Type coercion two more times

Perry A. Stoll stoll@atr-sw.atr.co.jp
Sat, 27 Jan 1996 00:35:12 +0900


>>>>> "HK" == Hinsen Konrad <hinsenk@ERE.UMontreal.CA> writes:

    HK> On the contrary, you are 14 hours ahead of us (us on the East

Yes, I realized that this afternoon as I left work for the
weekend. BTW, have a good day at work/school today :-) But don't ask
why I'm logged in after midnight to read this mail :-)

    HK> Basically that means having two array types with different
    HK> behaviour, and hiding that distinction in an attribute. Which

Maybe, but it seems like we're trying to satisfy two conflicting
constraints, namely, 
 1) providing a nice, consistant array library usable for the
mathematically oriented (potential) Python user, and
2) providing easy access to custom, relatively low level number
crunching and control of C types, i.e. 16 bit speech data, 8 bit
images, etc.

    HK> means most users won't be aware of its existence and will be
    HK> surprised the first time they get something else than they
    HK> expect.

Most users won't care about its existance unless they fall into group
2) above. Then they must care about data type conversion and this
provides some degree of control. I'm not saying it's good; this is a
real problem.

    HK> Besides, it doesn't solve Jim's problem of mixing C float
    HK> arrays with Python float scalars.
I thought it did - can you explain this a bit more? I'm probably
missing something. 

    HK> If you consider scalars to be of "coercible" type, then you
    HK> run into the same problem as with Jim's second proposal. 

I see. Yes, the question of whether or not to to convert scalars is
pivotal. If someone is using a type other than a Python numeric
type, then doesn't that mean they are willing to accept the loss of
precision? If you have an array_f, do you expect calculations with
PyFloats to occur at C double precision? I say by using an array_f,
you say "I want C float precision!". 

-Perry




=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================