From 189ab7f806afbf7d916aca480c8ff454938d3018 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Sun, 17 Mar 2024 09:07:50 +0100 Subject: [PATCH] Improve docstring --- src/attr/validators.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/attr/validators.py b/src/attr/validators.py index 0632214a..0695cd2f 100644 --- a/src/attr/validators.py +++ b/src/attr/validators.py @@ -110,16 +110,14 @@ class _InstanceOfValidator: 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)