On Tue, Apr 26, 2005 at 09:59:29PM -0500, Mike Meyer wrote:
> Jeff Epler <[EMAIL PROTECTED]> writes:
> 
> >     items = query_param.items()
> >     keys = [item[0] for item in items]
> >     values = [item[1] for item in items]
> 
> Is there some reason not to do:
> 
>    keys = query_params.keys()
>    values = query_params.values()
> 
> That would seem to be a lot more obvious as to what was going on.

I was afraid that .keys() and .values() might not "match up" (so that
the i'th key maps to the i'th value in query_param).  Now that I've
glanced at the documentation, I see that this *is* guaranteed[1], and
I should have written the code you proposed.

Jeff
[1] http://docs.python.org/lib/typesmapping.html note 3

Attachment: pgpxQa6k4Ldvu.pgp
Description: PGP signature

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

Reply via email to