Fix typo: double "be" (#373)
This commit is contained in:
parent
879f43d355
commit
7a80d57d1c
|
@ -278,7 +278,7 @@ Converters are run *before* validators, so you can use validators to check the f
|
||||||
|
|
||||||
>>> def validate_x(instance, attribute, value):
|
>>> def validate_x(instance, attribute, value):
|
||||||
... if value < 0:
|
... if value < 0:
|
||||||
... raise ValueError("x must be be at least 0.")
|
... raise ValueError("x must be at least 0.")
|
||||||
>>> @attr.s
|
>>> @attr.s
|
||||||
... class C(object):
|
... class C(object):
|
||||||
... x = attr.ib(converter=int, validator=validate_x)
|
... x = attr.ib(converter=int, validator=validate_x)
|
||||||
|
@ -288,7 +288,7 @@ Converters are run *before* validators, so you can use validators to check the f
|
||||||
>>> C("-1")
|
>>> C("-1")
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
ValueError: x must be be at least 0.
|
ValueError: x must be at least 0.
|
||||||
|
|
||||||
|
|
||||||
Arguably, you can abuse converters as one-argument validators:
|
Arguably, you can abuse converters as one-argument validators:
|
||||||
|
|
Loading…
Reference in New Issue