[Python-Dev] Indexing builtin sequences with objects which supply
Thu, 20 Jun 2002 18:19:17 -0400
Guido van Rossum wrote:
>>There has been some recent interest in the Numeric/numarray community
>>for using array objects as indices
>>for builtin sequences. I know this has come up before, but to make
>>myself clear, the basic idea is to make the
>> def __int__(self):
>> return 5
>>object = C()
>>l = "Another feature..."
>>Are there any plans (or interest) for developing Python in this direction?
>I'm concerned that this will also make floats acceptable as indices
>(since they have an __int__ method) and this would cause atrocities
>--Guido van Rossum (home page: http://www.python.org/~guido/)
>Python-Dev mailing list
That makes sense. What if we specifically excluded Float objects from
the conversion? Are there any types that need to be excluded? If
there's a chance of getting a patch for this accepted, STSCI is willing
to do the work.
Todd Miller firstname.lastname@example.org
STSCI / SSG (410) 338 4576