Dave Angel wrote:
Colin J. Williams wrote:
Steven
D'Aprano wrote:
On Fri, 14 Aug 2009 15:54:54 +, Alan G Isaac wrote:
`lst` is a nested list
`tpl` is the indexes for an item in the list
What is the nice way to retrieve the item? (Speedy access is nice.)
Assuming you want to do thi
Colin J. Williams wrote:
Steven
D'Aprano wrote:
On Fri, 14 Aug 2009 15:54:54 +, Alan G Isaac wrote:
`lst` is a nested list
`tpl` is the indexes for an item in the list
What is the nice way to retrieve the item? (Speedy access is nice.)
Assuming you want to do this frequently, write a
On 8/14/2009 1:09 PM Steven D'Aprano apparently wrote:
> Try this instead:
>
from operator import getitem
reduce(getitem, (2, 1, 0), lst)
> 'aaa'
reduce(getitem, (2, 1, 0, 0), lst)
> 'a'
>
> operator.getitem is less ugly too.
Yes, that's better.
Thanks,
Alan
--
http://mail.pytho
Steven D'Aprano wrote:
On Fri, 14 Aug 2009 15:54:54 +, Alan G Isaac wrote:
`lst` is a nested list
`tpl` is the indexes for an item in the list
What is the nice way to retrieve the item? (Speedy access is nice.)
Assuming you want to do this frequently, write a helper function, then
us
On Fri, 14 Aug 2009 15:54:54 +, Alan G Isaac wrote:
> `lst` is a nested list
>
> `tpl` is the indexes for an item in the list
> What is the nice way to retrieve the item? (Speedy access is nice.)
Assuming you want to do this frequently, write a helper function, then
use it:
# Untested
def