[issue4510] ValueError for list.remove() not very helpful

2010-11-02 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

This has already been implemented.

--
nosy: +benjamin.peterson
resolution:  - out of date
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4510] ValueError for list.remove() not very helpful

2010-07-26 Thread Tim Lesher

Tim Lesher tles...@gmail.com added the comment:

Ugh.  That's a reasonable objection.

What's the best thing to do in this case, generally speaking?

list.index() does print the full repr on a value error; and a quick grep shows 
a number of other similar uses, although those don't seem to be as easy to 
trigger inadvertently.

Should this feature be removed from list.index as well?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4510] ValueError for list.remove() not very helpful

2010-07-23 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Amaury, I agree about having a limit.  It is a really bad idea to dump the full 
list repr for a potentially huge list or even for a small list of objects with 
huge individual reprs.   We should limit the output to just a few characters at 
most or risk spewing pages of garbage into people's tracebacks and log files.

That being said, limiting the output defeats the original purpose of the 
feature request.  ISTM that the proposal is only helpful in simple toy examples 
like [1,2,3].remove(4).  With real world data, the new message is probably 
going to cause more harm than good.  Accordingly, I recommend rejecting this 
feature request.

--
nosy: +rhettinger
type: behavior - feature request
versions: +Python 3.2 -Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4510] ValueError for list.remove() not very helpful

2010-07-21 Thread Tim Lesher

Tim Lesher tles...@gmail.com added the comment:

It looks as if this has been addressed for list.index (aka issue #7252), in 
r76058.  The same fix could be applied for list.remove.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4510] ValueError for list.remove() not very helpful

2010-07-21 Thread Tim Lesher

Tim Lesher tles...@gmail.com added the comment:

This patch combines the fix from Georg Brandl's original patch with the fix 
made to listindex.  The r76058 fix fails the test in Georg's original test 
where the repr of the item to be removed itself raises; this patch handles that 
case for both list.remove and list.index.

--
Added file: http://bugs.python.org/file18110/improve_list_remove_error.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4510] ValueError for list.remove() not very helpful

2010-07-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

The patch is good, except for two things:
when PyObject_Repr() fails, the word 'item' is put instead. This is a good 
idea, but PyErr_Clear() should be called as soon as possible, before calling 
another API function.
Also, the error message can grow without bounds. It would be better to limit 
the size of the string.

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4510] ValueError for list.remove() not very helpful

2009-03-10 Thread Tim Lesher

Changes by Tim Lesher tles...@gmail.com:


--
nosy: +tlesher
nosy_count: 2.0 - 3.0

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4510] ValueError for list.remove() not very helpful

2008-12-05 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Suggested patch attached, handles remove() and index().

--
keywords: +patch
nosy: +georg.brandl
stage: needs patch - patch review
Added file: http://bugs.python.org/file12244/list-excs.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4510] ValueError for list.remove() not very helpful

2008-12-03 Thread Brett Cannon

New submission from Brett Cannon [EMAIL PROTECTED]:

If you try to remove something from a list, e.g. ``[].remove(1)``, the
message from ValueError is rather useless: ValueError: list.remove(x):
x not in list. It should probably list the repr for the argument to
help in debugging.

--
keywords: easy
messages: 76852
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: ValueError for list.remove() not very helpful
type: behavior
versions: Python 2.7, Python 3.1

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4510
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com