From 402b8255392a841e9ae81e4df4467e174c90a06b Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Tue, 5 Apr 2016 10:48:17 +0200 Subject: [PATCH] Clarify instance_of validator also takes tuples --- src/attr/validators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/attr/validators.py b/src/attr/validators.py index 01b7b108..13a93664 100644 --- a/src/attr/validators.py +++ b/src/attr/validators.py @@ -35,13 +35,13 @@ def instance_of(type): """ A validator that raises a :exc:`TypeError` if the initializer is called 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. - :type type: type + :type type: type or tuple of types 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. """ return _InstanceOfValidator(type)