@@ -41,7 +41,10 @@ def _is_optional(type_hint: Type) -> bool: # type: ignore
4141 """Check if the type hint is :data:`~typing.Optional`.
4242
4343 :param type_hint: Type hint to check.
44+ :type type_hint: Type
45+
4446 :return: True if the type hint is :data:`~typing.Optional`, False otherwise.
47+ :rtype: bool
4548
4649 :Example:
4750
@@ -62,7 +65,10 @@ def _make_optional(type_hint: Type) -> Type: # type: ignore
6265 """Wrap type hint with :data:`~typing.Optional` if it's not already.
6366
6467 :param type_hint: Type hint to wrap.
68+ :type type_hint: Type
69+
6570 :return: Type hint wrapped with :data:`~typing.Optional`.
71+ :rtype: Type
6672
6773 :Example:
6874
@@ -85,10 +91,14 @@ def _is_allow_empty(value: Any, type_hint: Type, allow_empty: bool) -> bool: #
8591 """Determine if the value is considered empty and whether it's allowed.
8692
8793 :param value: Value to check.
94+ :type value: Any
8895 :param type_hint: Type hint to check against.
96+ :type type_hint: Type
8997 :param allow_empty: Whether to allow empty values.
98+ :type allow_empty: bool
9099
91100 :return: True if the value is empty and allowed, False otherwise.
101+ :rtype: bool
92102
93103 :Example:
94104
@@ -118,11 +128,16 @@ def _check_type(value: Any, expected_type: Type, allow_empty: bool = False, curr
118128 """Check if the value matches the expected type, recursively if necessary.
119129
120130 :param value: Value to check.
131+ :type value: Any
121132 :param expected_type: Expected type.
133+ :type expected_type: Type
122134 :param allow_empty: Whether to allow empty values.
135+ :type allow_empty: bool
123136 :param curr_depth: Current depth of the recursive check.
137+ :type curr_depth: int
124138
125139 :return: True if the value matches the expected type, False otherwise.
140+ :rtype: bool
126141
127142 :Example:
128143
0 commit comments