Improve docstring
This commit is contained in:
parent
d812e920cc
commit
189ab7f806
|
@ -110,16 +110,14 @@ class _InstanceOfValidator:
|
||||||
|
|
||||||
def instance_of(type):
|
def instance_of(type):
|
||||||
"""
|
"""
|
||||||
A validator that raises a `TypeError` if the initializer is called
|
A validator that raises a `TypeError` if the initializer is called with a
|
||||||
with a wrong type for this particular attribute (checks are performed using
|
wrong type for this particular attribute (checks are performed using
|
||||||
`isinstance` therefore it's also valid to pass a tuple of types).
|
`isinstance` therefore it's also valid to pass a tuple of types).
|
||||||
|
|
||||||
:param type: The type to check for.
|
:param type | tuple[type] type: The type to check for.
|
||||||
:type type: type or tuple of type
|
|
||||||
|
|
||||||
:raises TypeError: With a human readable error message, the attribute
|
:raises TypeError: With a human readable error message, the attribute (of
|
||||||
(of type `attrs.Attribute`), the expected type, and the value it
|
type `attrs.Attribute`), the expected type, and the value it got.
|
||||||
got.
|
|
||||||
"""
|
"""
|
||||||
return _InstanceOfValidator(type)
|
return _InstanceOfValidator(type)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue