[MATRIX-SIG] integer division -- what a concept!

Konrad Hinsen hinsen@ibs.ibs.fr
Wed, 21 Jan 1998 10:40:04 +0100


> With all this talk about fixing Python so it behaves reasonably, I
> guess the fix I would most like to see would be some sort of a "type
> constraint" mechanism.  If I could've said that that the operands to
> my function were constrained to be of some type that supported
> floating point arithematic, then I wouldn't have been bit.  

Python even has such a mechanism - but only for C functions. If you
ask PyArg_ParseTuple() to parse an argument as float or double, it
will also accept and convert integers.

There was some discussion on optional type specifications at the last
Python Conference; if something like that ever gets implemented,
we might succeed in getting such a type constraint mechanism as
a byproduct.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

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