On 19.02.2005, at 05:37, Robert Kern wrote:
I don't see the problem that this approach would solve. It doesn't solve the list/tuple indexing problem by itself. Even if the types are part of the standard library, they won't be bona-fide ints, so the indexing code would still have to be modified to check for them.
Yes, but it could check for "integer type" (using the type hierarchy) rather than convert everything to an integer with the problem that Guido pointed out. However, my original motivation was consistency of usage. Python has type objects to specify types, so I'd rather use them than introduce another way to specify the type of array elements.
I *do* like the idea of the typecode objects, however they are implemented, to be able to act as constructors.
That is an interesting idea as well, though a slightly different one. Konrad. -- ------------------------------------------------------------------------ ------- Konrad Hinsen Laboratoire Leon Brillouin, CEA Saclay, 91191 Gif-sur-Yvette Cedex, France Tel.: +33-1 69 08 79 25 Fax: +33-1 69 08 82 61 E-Mail: khinsen@cea.fr ------------------------------------------------------------------------ -------