Clarify instance_of validator also takes tuples

This commit is contained in:
Hynek Schlawack 2016-04-05 10:48:17 +02:00
parent 694598a36d
commit 402b825539
1 changed files with 3 additions and 3 deletions

View File

@ -35,13 +35,13 @@ def instance_of(type):
""" """
A validator that raises a :exc:`TypeError` if the initializer is called A validator that raises a :exc:`TypeError` if the initializer is called
with a wrong type for this particular attribute (checks are perfomed using with a wrong type for this particular attribute (checks are perfomed using
:func:`isinstance`). :func:`isinstance` therefore it's also valid to pass a tuple of types).
:param type: The type to check for. :param type: The type to check for.
:type type: type :type type: type or tuple of types
The :exc:`TypeError` is raised with a human readable error message, the The :exc:`TypeError` is raised with a human readable error message, the
attribute (of type :class:`attr.Attribute`), the expected type and the attribute (of type :class:`attr.Attribute`), the expected type, and the
value it got. value it got.
""" """
return _InstanceOfValidator(type) return _InstanceOfValidator(type)