Converting to lists into one dictionary

Brian E Gallew geek+ at cmu.edu
Mon Oct 4 15:36:32 EDT 1999


Then <ivanlan at callware.com> spoke up and said:
> This makes me wonder--why is there no canonical "dict()" built in
> function?  We have "long()", "list()" and so on, but nothing like them
> for dictionaries.  They all know what to do when fed improper input.

Because there is no obviously correct behaviour for such a function.
Two obvious cases:
a) dict(list1, list2) # What should it do if the lists aren't the same
size?
b) dict(list1) # Is list1 keys, values, or both?

-- 
=====================================================================
| JAVA must have been developed in the wilds of West Virginia.      |
| After all, why else would it support only single inheritance??    |
=====================================================================
| Finger geek at cmu.edu for my public key.                            |
=====================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 266 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/19991004/79c0095b/attachment.sig>


More information about the Python-list mailing list