[Pyrex] [Cython-dev] Optimizing use of lists
Robert Bradshaw
robertwb at math.washington.edu
Wed Nov 28 02:19:16 CET 2007
On Nov 27, 2007, at 4:02 PM, Greg Ewing wrote:
> I wrote:
>
>> Something similar will also have to be done for type
>> slots, so that some_list[i] can be translated into
>> PyList_GetItem, etc.
>
> On second thoughts, I'm not sure this is really the best
> thing to do in the case of typeslot methods. It would mean
> that subclasses of list that overrode the typeslot would
> not have the overridden method called in some circumstances,
> which could lead to surprising results.
I think such types should be exactly lists, tuples, etc. (a la
PyList_CheckExact). For subclasses of lists the generic code would
have to be used, just as it is generated now.
- Robert
More information about the Pyrex
mailing list