Message240952
The error message isn't wrong, just hard to understand. In your example, when it says "need more than 4 values to unpack" it means that it got four values on the right hand side, and needs five (which is more than four) to match what is on the left.
When the error is the other way around, with too few targets on the left, the error message is more understandable:
a, b = (1, 2, 3)
gives
ValueError: too many values to unpack (expected 2).
Your example should be fixed to something similar. I think it would be useful for both cases to report "expected %d, got %d" rather than just one or the other.
By the way, I don't think that changes to error messages will be back-ported to old versions like 3.2, but only added to the latest version. |
|
Date |
User |
Action |
Args |
2015-04-14 16:58:09 | steven.daprano | set | recipients:
+ steven.daprano, skip.montanaro, ulaganathanm123@gmail.com |
2015-04-14 16:58:09 | steven.daprano | set | messageid: <1429030689.24.0.183843396624.issue23949@psf.upfronthosting.co.za> |
2015-04-14 16:58:09 | steven.daprano | link | issue23949 messages |
2015-04-14 16:58:09 | steven.daprano | create | |
|