Skip to content

Commit

Permalink
Improve docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Mar 17, 2024
1 parent d812e92 commit 189ab7f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/attr/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,14 @@ def __repr__(self):

def instance_of(type):
"""
A validator that raises a `TypeError` if the initializer is called
with a wrong type for this particular attribute (checks are performed using
A validator that raises a `TypeError` if the initializer is called with a
wrong type for this particular attribute (checks are performed using
`isinstance` therefore it's also valid to pass a tuple of types).
:param type: The type to check for.
:type type: type or tuple of type
:param type | tuple[type] type: The type to check for.
:raises TypeError: With a human readable error message, the attribute
(of type `attrs.Attribute`), the expected type, and the value it
got.
:raises TypeError: With a human readable error message, the attribute (of
type `attrs.Attribute`), the expected type, and the value it got.
"""
return _InstanceOfValidator(type)

Expand Down

0 comments on commit 189ab7f

Please sign in to comment.