Newbie Question: Obtain element from list of tuples

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sun Dec 18 22:00:59 EST 2011


On Sun, 18 Dec 2011 18:35:47 -0800, alex23 wrote:

> Pre-namedtuple, I used to like using named slices for this:
> 
>     cPID = slice(19)
>     pid = recs[cPID]

You know, that is an incredibly simple thing and yet it never dawned on 
me before now. Thank you for sharing that.



-- 
Steven



More information about the Python-list mailing list