Skip to content

Commit

Permalink
PEP 726: Fix error message description (#3562)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2023
1 parent 8fe50a0 commit 108ca0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions peps/pep-0726.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -279,7 +279,7 @@ See `related issue
<https://github.com/python/cpython/issues/106016#issue-1771174774>`__ 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`.
Expand Down

0 comments on commit 108ca0a

Please sign in to comment.