Skip to content

Commit 189ab7f

Browse files
committed
Improve docstring
1 parent d812e92 commit 189ab7f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/attr/validators.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,14 @@ def __repr__(self):
110110

111111
def instance_of(type):
112112
"""
113-
A validator that raises a `TypeError` if the initializer is called
114-
with a wrong type for this particular attribute (checks are performed using
113+
A validator that raises a `TypeError` if the initializer is called with a
114+
wrong type for this particular attribute (checks are performed using
115115
`isinstance` therefore it's also valid to pass a tuple of types).
116116
117-
:param type: The type to check for.
118-
:type type: type or tuple of type
117+
:param type | tuple[type] type: The type to check for.
119118
120-
:raises TypeError: With a human readable error message, the attribute
121-
(of type `attrs.Attribute`), the expected type, and the value it
122-
got.
119+
:raises TypeError: With a human readable error message, the attribute (of
120+
type `attrs.Attribute`), the expected type, and the value it got.
123121
"""
124122
return _InstanceOfValidator(type)
125123

0 commit comments

Comments
 (0)