PEP 726: Fix error message description (#3562)
* 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 <lukasz@langa.pl> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
parent
8fe50a0397
commit
108ca0a79a
|
@ -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
|
|||
<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`.
|
||||
|
|
Loading…
Reference in New Issue