[Python-Dev] Indexing builtin sequences with objects which supply
__int__
Todd Miller
jmiller@stsci.edu
Sun, 23 Jun 2002 09:37:12 -0400
Scott Gilbert wrote:
>--- Todd Miller:
>
>>Right now, numarray is a subclass of object for Python-2.2 in order to
>>get properties in order to emulate some of Numeric's attributes. I'm
>>wondering what I'd loose from object in order to pick up int's indexing.
>>
>
>Since int is also a subclass of object, you'd still get the benefits of new
>style classes...
>
Well, that's excellent!
>
>> I'm also wondering how to make a rank-0 Float array fail as an index.
>>
>
>Raise a TypeError and it would match the standard behavior.
>
Raise TypeError where? I was thinking I'd have to either inherit from
int, or not, depending on the type of the array. It still might work
out though...
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! - Official partner of 2002 FIFA World Cup
>http://fifaworldcup.yahoo.com
>