[docs] [issue34133] ValueError should not be documented as being restricted to only "a built-in operation or function"
report at bugs.python.org
Mon Jul 16 20:51:44 EDT 2018
New submission from Nathaniel Manista <nathaniel at 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 at python
nosy: Nathaniel Manista, docs at python
title: ValueError should not be documented as being restricted to only "a built-in operation or function"
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Python tracker <report at bugs.python.org>
More information about the docs