Type¶
-
class
typerighter.types.base.
Type
(*a, **kw)[source]¶ This class represents the top, and thus most ambiguous, point of the Typerighter hierarchy.
It’s purpose is to define the baseline expectations for every other Type in this library.
-
NATIVE
¶ alias of
builtins.object
-
is_coercible
(value)[source]¶ Checks a value for whether or not it can be converted to the correct type. Falls back to the stricter is_type_match if self.strict is True.
- Parameters
value (object) – The value to inspect
-
is_falsy
(value)[source]¶ Checks a value and responds saying whether the Type considers it falsy.
- Parameters
value (object) – The value to inspect
- Returns
True or False
-
is_type_match
(value)[source]¶ Checks if a value is an instance of this Type’s native type. :param object value: The value to inspect
-
to_native
(value)[source]¶ Converts a value to the native form of this type
- Parameters
value (object) – The value to convert
-