Converting to lists into one dictionary

Tim Peters tim_one at email.msn.com
Wed Oct 6 01:03:01 EDT 1999


[Tim]
>      raise ValueError("dict(seq1, seq2): seq2 must be at least "
>                       "as long as seq1")

[Magnus L. Hetland]
> Why?

Because it's probably an error when it occurs.

> Why not pad with None?

Because it's probably an error when it occurs.

None-padding was a mistake for "map", and there's no reason to believe it's
a better idea here.  If your *intent* is to fill up the tail with None,
that's easy to spell explicitly.

> I think it would be worse if len(seq2)>len(seq1) - because you
> couldn't pad the keys with Nones...

None is a valid key.  If you're going to adopt half a bad idea, go all the
way <0.5 wink>.

else-the-spurned-orphan-will-murder-us-in-our-sleep-ly y'rs  - tim






More information about the Python-list mailing list