[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

[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

[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

[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

[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

[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

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

[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

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