loop beats generator expr creating large dict!?
Steven Bethard
steven.bethard at gmail.com
Tue Oct 3 10:30:46 EDT 2006
David Isaac wrote:
> Does George's example raise the question:
> why do dictionaries not implement efficient creation
> for two common cases?
>
> - Making a dict from two sequences of the same length.
> - Making a dict from a sequence and a function
> (as in George's example in this thread).
Maybe you should lobby for dict comprehensions in Python 3000. It
already has set comprehensions:
http://www.python.org/dev/peps/pep-3100/
STeVe
More information about the Python-list
mailing list