From 108ca0a79afab8ce0e09579bba3412867d6016a6 Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Tue, 12 Dec 2023 15:58:40 +1100 Subject: [PATCH] PEP 726: Fix error message description (#3562) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * PEP 726: Fix error message description Zero is a non-negative number, but since zero is being excluded here, the check is really ensuring that it is a positive number. * s/overriden/overridden/ --------- Co-authored-by: Ɓukasz Langa Co-authored-by: Hugo van Kemenade --- peps/pep-0726.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/peps/pep-0726.rst b/peps/pep-0726.rst index 40912dba7..b40647684 100644 --- a/peps/pep-0726.rst +++ b/peps/pep-0726.rst @@ -59,7 +59,7 @@ For example def validate(n): n = int(n) if n <= 0: - raise ValueError('non-negative integer expected') + raise ValueError('Positive integer expected') return n def __setattr__(name, value): @@ -105,7 +105,7 @@ For example >>> mplib.dps = 0 Traceback (most recent call last): ... - ValueError: non-negative integer expected + ValueError: Positive integer expected Existing Options @@ -279,7 +279,7 @@ See `related issue `__ for other details. -Other stdlib modules also come with attributes which can be overriden (as a +Other stdlib modules also come with attributes which can be overridden (as a feature) and some input validation here could be helpful. Examples: :py:obj:`threading.excepthook`, :py:obj:`warnings.showwarning`, :py:obj:`io.DEFAULT_BUFFER_SIZE` or :py:obj:`os.SEEK_SET`.