[Python-Dev] Indexing builtin sequences with objects which supply __int__
Alex Martelli
aleax@aleax.it
Fri, 21 Jun 2002 10:20:02 +0200
On Friday 21 June 2002 03:29 am, Guido van Rossum wrote:
...
> This points to an unfortunate early design flaw in Python (inherited
> from C casts): __int__ has two different meanings -- sometimes it
> converts the type, sometimes it also truncates the value.
That's inherent in any conversion to a type which has multiple purposes. I
wouldn't call it a "design flaw" -- it's a "flaw" (?) in the underlying
reality:-).
> I hesitate to propose a new special method, but that may be the only
> solution. :-(
PEP 246...
Alex