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

2010-11-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: This has already been implemented. -- nosy: +benjamin.peterson resolution: -> out of date status: open -> closed ___ Python tracker ___

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

2010-07-26 Thread Tim Lesher
Tim Lesher 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 i

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

2010-07-23 Thread Raymond Hettinger
Raymond Hettinger 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 spew

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

2010-07-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 witho

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

2010-07-21 Thread Tim Lesher
Tim Lesher 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 li

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

2010-07-21 Thread Tim Lesher
Tim Lesher 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 _

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

2009-03-10 Thread Tim Lesher
Changes by Tim Lesher : -- nosy: +tlesher nosy_count: 2.0 -> 3.0 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[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 ___ Pyth

[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. --