Too Many Values To Unpack
Gregory Ewing
greg.ewing at canterbury.ac.nz
Sun Nov 22 00:19:49 EST 2009
Dennis Lee Bieber wrote:
> I apparently thought "for ... in dictionary" would return (key,
> value) pairs, but it appears that it only returns the key itself -- and
> a single key can't be unpacked.
>
> Misleading error... too many /targets/ to unpack...
My guess is that the keys are strings, which means it's
unpacking them into characters, in which case a key of
length 3 or more will produce that message.
--
Greg
More information about the Python-list
mailing list