Skip to content

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 7, 2025

Unify error messages for the index() and remove() methods of classes list, tuple, range, memoryview, str, bytes, bytearray, array.array, and collections.deque, and the operator.indexOf() function.

Improve error message for xml.etree.ElementTree.Element.remove().

Unify error messages for the index() and remove() methods of classes
list, tuple, range, memoryview, str, bytes, bytearray, array.array,
and collections.deque, and the operator.indexOf() function.

Improve error message for xml.etree.ElementTree.Element.remove().
return NULL;
}
PyErr_SetString(PyExc_ValueError, "list.remove(x): x not in list");
PyErr_SetString(PyExc_ValueError, "value not in list");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this just makes the messages slightly less informative. Personally, I don't see this as an improvement.

}
}
PyErr_SetString(PyExc_ValueError, "deque.index(x): x not in deque");
PyErr_SetString(PyExc_ValueError, "value not in deque");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the message be left as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants