Kent Johnson wrote:
> [EMAIL PROTECTED] wrote:
> > p.s. the reason I'm not sticking to reversed or even reverse :
suppose
> > the size of the list is huge.
>
> reversed() returns an iterator so list size shouldn't be an issue.
>
> What problem are you actually trying to solve?
>
> Kent
>

Oh, you are right.

Actually, it's more complicated than simple reversion. The list order
should be somewhat "twisted" and the list is big.

For example,

[1,2,3,4,5,6,7,8,9,10]

--> [10,9,8,7,6,1,2,3,4,5]

so __getitem__(self,i) => __getitem__(self,-i-1) if i<len(size)/2,
otherwise __getitem__(self,i-len(size)/2)

I'd like to have TwistedList class that takes in an original list and
pretends as if it is twisted actually. However, I have to have
duplicate codes here and there to make it act like a "list", say assert
twisted_list == [10,9,...] and for each in twisted_list and etc.

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

Reply via email to