[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2018-09-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2018-09-02 Thread Lorenz Mende
Lorenz Mende added the comment: This issue shall be closed, as the solution is already on master with 4171bbe687904582329c7977d571686953275b45. -- nosy: +LorenzMende ___ Python tracker

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: Removed file: http://bugs.python.org/file39011/issue23949.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23949 ___

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Skip Montanaro
Skip Montanaro added the comment: I like the idea of the too many and not enough messages being symmetric. If it's not too hard, I would prefer them to both identify the number of expected and received values. I don't have a recent checkout at hand though, so it's non-trivial for me to

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari
Arnon Yaari added the comment: I couldn't find a way to add 'got %d' to the 'too many values' message. This would either require going over the rest of the iterator (which will take more time and may never return) or trying to figure out if it has a 'len' member. I didn't find any place in

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: Added file: http://bugs.python.org/file39042/issue23949-2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23949 ___

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari
Arnon Yaari added the comment: I fixed the tests (that's important!) and changed the latter message to specify it is referring to the starred target (the term starred target appears in the docs in simple_stmts.rst). Looks like the number in that message was wrong before! The test looked like

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: Added file: http://bugs.python.org/file39043/issue23949-3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23949 ___

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Arnon Yaari
Arnon Yaari added the comment: Sorry, I got confused (which proves the point of the ticket :)) * the need more than 3 values error message wasn't wrong, just confusing. * Including into starred target in the message was incorrect, I removed it. * The message with expected at least ... (when

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset e55cc0834e9c by R David Murray in branch 'default': #23949: Improve tuple unpacking error messages. https://hg.python.org/cpython/rev/e55cc0834e9c -- nosy: +python-dev ___ Python tracker

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-14 Thread Ulaga Nathan Mahadevan
Ulaga Nathan Mahadevan added the comment: I agree. I posted it as an enhancement request. Steven explained the expected message clearly. Thanks. On Tue, Apr 14, 2015 at 12:58 PM, Steven D'Aprano rep...@bugs.python.org wrote: Steven D'Aprano added the comment: The error message isn't wrong,

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-14 Thread Ulaga Nathan Mahadevan
New submission from Ulaga Nathan Mahadevan: data = ['David',50,91.1,(2012,12,21)] print (Data = ,data) name,shares,price,date,value = data print(Name = ,name, , no of shares = ,shares,, unit price = ,price,, date of purchase = ,date) After running the script Data = ['David', 50, 91.1, (2012,

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-14 Thread Skip Montanaro
Skip Montanaro added the comment: I'm not sure I understand the problem is. You have a list containing four values, and try to unpack it into five individual objects. There is no element in the list data to assign the name value. -- nosy: +skip.montanaro

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: 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

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-14 Thread Martin Panter
Martin Panter added the comment: Either option would be an improvement. I think I prefer issue23949.diff by Arnon. I guess it would then look like this: name,shares,price,date,value = data Traceback (most recent call last): File stdin, line 1, in module ValueError: not enough values to

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-14 Thread William Orr
William Orr added the comment: I've updated the error message to just include the expected number of arguments. I think this makes it way more readable. -- keywords: +patch nosy: +worr Added file: http://bugs.python.org/file39010/maxvalueerror.patch

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-14 Thread Arnon Yaari
Arnon Yaari added the comment: Adding alternative patch for suggestion. -- nosy: +wiggin15 versions: +Python 3.5 -Python 3.2 Added file: http://bugs.python.org/file39011/issue23949.diff ___ Python tracker rep...@bugs.python.org