New submission from Nathaniel Manista <nathan...@google.com>:

The documentation for ValueError currently describes it as being "Raised when a 
built-in operation or function receives an argument that has the right type but 
an inappropriate value, and the situation is not described by a more precise 
exception such as IndexError.", but the Python community has (quite rightly!) 
adopted it as the exception to raise in any system when that system is passed a 
value for a parameter that is type-correct but of an invalid value.

(Because what, is every library going to present a "my_library.ValueError" 
exception instead? That would be ridiculous.)

ValueError's documentation should drop the "a built-in operation or function" 
wording.

Perhaps go with something like "When raised indicates that a function or method 
was passed a value of the correct type but an invalid value"?

----------
assignee: docs@python
components: Documentation
messages: 321784
nosy: Nathaniel Manista, docs@python
priority: normal
severity: normal
status: open
title: ValueError should not be documented as being restricted to only "a 
built-in operation or function"
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34133>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to