Too Many Values To Unpack
greg.ewing at canterbury.ac.nz
Sun Nov 22 06:19:49 CET 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.
More information about the Python-list