Title: ValueError documented as being restricted to only "a built-in operation or function"
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Nathaniel Manista, brett.cannon, docs@python, rhettinger
Priority: normal Keywords: patch

Created on 2018-07-17 00:51 by Nathaniel Manista, last changed 2018-07-17 22:54 by Nathaniel Manista. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8313 merged rhettinger, 2018-07-17 07:05
PR 8316 merged miss-islington, 2018-07-17 15:55
PR 8315 merged miss-islington, 2018-07-17 15:56
PR 8317 merged miss-islington, 2018-07-17 15:56
Messages (4)
msg321784 - (view) Author: Nathaniel Manista (Nathaniel Manista) Date: 2018-07-17 00:51
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"?
msg321844 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2018-07-17 17:41
Just an FYI, Nathaniel, your title and message are bit "pushy". I've gone ahead and tweaked the title.
msg321851 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-07-17 20:26
Nathaniel, thanks for the bug report. I've fixed the docs.
msg321854 - (view) Author: Nathaniel Manista (Nathaniel Manista) Date: 2018-07-17 22:54
Thank you both!
Date User Action Args
2018-07-17 22:54:42Nathaniel Manistasetmessages: + msg321854
2018-07-17 20:26:26rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg321851

stage: patch review -> resolved
2018-07-17 17:41:39brett.cannonsetnosy: + brett.cannon

messages: + msg321844
title: ValueError should not be documented as being restricted to only "a built-in operation or function" -> ValueError documented as being restricted to only "a built-in operation or function"
2018-07-17 15:56:14miss-islingtonsetpull_requests: + pull_request7852
2018-07-17 15:56:07miss-islingtonsetpull_requests: + pull_request7851
2018-07-17 15:55:58miss-islingtonsetpull_requests: + pull_request7850
2018-07-17 07:05:10rhettingersetkeywords: + patch
stage: patch review
pull_requests: + pull_request7848
2018-07-17 06:57:21rhettingersetassignee: docs@python -> rhettinger

nosy: + rhettinger
2018-07-17 00:51:44Nathaniel Manistacreate