[issue3071] The ValueError raised by failing to unpack sequence should have more information.

Jack Diederich report at bugs.python.org
Mon Jul 27 05:46:24 CEST 2009


Jack Diederich <jackdied at gmail.com> added the comment:

I was looking at 3.x, JP's patch is relative to 2.x and takes a little
more unpacking (a couple function calls more) but looks to me to be the
same.  In 2.x unpack_iterable() sets/returns an error once one item more
than is required is received.  It doesn't give any more information
about known-length builtins than anything else.  The same error is
raised for million-item lists as three item lists if the expected number
to unpack is two.

The original feature request was that the error message be better if,
say the left hand side wanted three arguments and the right hand side
provided four.  The ceval.c code is different between 2.x and 3.x but
they both only check for 'exactly the right number, or one or more too
many.'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3071>
_______________________________________


More information about the Python-bugs-list mailing list