@@ -45,7 +45,7 @@ _ClassValidatorType: TypeAlias = Callable[[object | str | None], type[Any] | Non
4545_UserGroupValidatorType : TypeAlias = Callable [[str | int | None ], int ]
4646_AddressValidatorType : TypeAlias = Callable [[str | None ], _AddressType | None ]
4747
48- _AnyValidatorType : TypeAlias = (
48+ _ValidatorType : TypeAlias = (
4949 _BoolValidatorType
5050 | _StringValidatorType
5151 | _ListStringValidatorType
@@ -111,7 +111,7 @@ class Setting(metaclass=SettingMeta):
111111 value : _ConfigValueType
112112 section : ClassVar [str | None ]
113113 cli : ClassVar [list [str ] | None ]
114- validator : ClassVar [_AnyValidatorType | None ]
114+ validator : ClassVar [_ValidatorType | None ]
115115 type : ClassVar [argparse ._ActionType | None ]
116116 meta : ClassVar [str | None ]
117117 action : ClassVar [str | None ]
@@ -158,15 +158,15 @@ def validate_list_of_existing_files(val: None) -> list[str]: ...
158158def validate_string_to_addr_list (val : str | None ) -> list [str ]: ...
159159def validate_string_to_list (val : str | None ) -> list [str ]: ...
160160@overload
161- def validate_class (val : str ) -> type [ Any ] : ...
161+ def validate_class (val : str ) -> str : ...
162162@overload
163163def validate_class (val : None ) -> None : ...
164164@overload
165- def validate_class (val : object ) -> type [ Any ] : ...
166- def validate_callable (arity : int ) -> Callable [[str | Callable [..., Any ]], Callable [..., Any ] ]: ...
165+ def validate_class (val : object ) -> object : ...
166+ def validate_callable (arity : int ) -> Callable [[str | _ValidatorType ], _ValidatorType ]: ...
167167def validate_user (val : int | str | None ) -> int : ...
168168def validate_group (val : int | str | None ) -> int : ...
169- def validate_post_request (val : str | Callable [..., Any ] ) -> _PostRequestHookType : ...
169+ def validate_post_request (val : str | _ValidatorType ) -> _PostRequestHookType : ...
170170def validate_chdir (val : str ) -> str : ...
171171@overload
172172def validate_statsd_address (val : str ) -> _AddressType : ...
0 commit comments