Terry Reedy wrote:

> 
>> If no __getslice__() is found, a slice object is created instead, and
>> passed to __getitem__() instead.
> 
> The  overwhelmingl most common case of a simple slice is more efficiently
> done by having a separate function since no slice object is created.
> 
>>>> a=[1,2,3]
>>>> def f(): return a[0:1]
> ...
>>>> import dis
>>>> dis.dis(f)

[...]

Very good point.  I always forget how useful dis is, thanks.

f

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to