1
- from collections .abc import Iterable
2
- from typing import Any
1
+ from collections .abc import Callable , Iterable
2
+ from typing import Any , TypeVar
3
+
4
+ _F = TypeVar ("_F" , bound = Callable [..., Any ])
3
5
4
6
class FormatChecker :
5
- checkers : Any
7
+ checkers : dict [str , tuple [Callable [[Any ], bool ], Exception | tuple [Exception , ...]]]
8
+
6
9
def __init__ (self , formats : Iterable [str ] | None = ...) -> None : ...
7
- def checks (self , format , raises = ...): ...
8
- cls_checks : Any
9
- def check (self , instance , format ) -> None : ...
10
- def conforms (self , instance , format ) -> bool : ...
10
+ def checks (self , format : str , raises : Exception | tuple [Exception , ...] = ...) -> Callable [[_F ], _F ]: ...
11
+ @classmethod
12
+ def cls_checks (cls , format : str , raises : Exception | tuple [Exception , ...] = ...) -> Callable [[_F ], _F ]: ...
13
+ def check (self , instance : Any , format : str ) -> None : ...
14
+ def conforms (self , instance : Any , format : str ) -> bool : ...
11
15
12
16
draft3_format_checker : FormatChecker
13
17
draft4_format_checker : FormatChecker
@@ -16,28 +20,28 @@ draft7_format_checker: FormatChecker
16
20
draft201909_format_checker : FormatChecker
17
21
draft202012_format_checker : FormatChecker
18
22
19
- def is_email (instance ) -> bool : ...
20
- def is_ipv4 (instance ) -> bool : ...
21
- def is_ipv6 (instance ) -> bool : ...
23
+ def is_email (instance : object ) -> bool : ...
24
+ def is_ipv4 (instance : object ) -> bool : ...
25
+ def is_ipv6 (instance : object ) -> bool : ...
22
26
23
27
# is_host_name is only defined if fqdn is installed.
24
- def is_host_name (instance ) -> bool : ...
25
- def is_idn_host_name (instance ) -> bool : ...
26
- def is_uri (instance ) -> bool : ...
27
- def is_uri_reference (instance ) -> bool : ...
28
- def is_iri (instance ) -> bool : ...
29
- def is_iri_reference (instance ) -> bool : ...
30
- def is_datetime (instance ) -> bool : ...
31
- def is_time (instance ) -> bool : ...
32
- def is_regex (instance ) -> bool : ...
33
- def is_date (instance ) -> bool : ...
34
- def is_draft3_time (instance ) -> bool : ...
35
- def is_css_color_code (instance ) -> bool : ...
36
- def is_css21_color (instance ) -> bool : ...
37
- def is_json_pointer (instance ) -> bool : ...
38
- def is_relative_json_pointer (instance ) -> bool : ...
39
- def is_uri_template (instance ) -> bool : ...
28
+ def is_host_name (instance : object ) -> bool : ...
29
+ def is_idn_host_name (instance : object ) -> bool : ...
30
+ def is_uri (instance : object ) -> bool : ...
31
+ def is_uri_reference (instance : object ) -> bool : ...
32
+ def is_iri (instance : object ) -> bool : ...
33
+ def is_iri_reference (instance : object ) -> bool : ...
34
+ def is_datetime (instance : object ) -> bool : ...
35
+ def is_time (instance : object ) -> bool : ...
36
+ def is_regex (instance : object ) -> bool : ...
37
+ def is_date (instance : object ) -> bool : ...
38
+ def is_draft3_time (instance : object ) -> bool : ...
39
+ def is_css_color_code (instance : object ) -> bool : ...
40
+ def is_css21_color (instance : object ) -> bool : ...
41
+ def is_json_pointer (instance : object ) -> bool : ...
42
+ def is_relative_json_pointer (instance : object ) -> bool : ...
43
+ def is_uri_template (instance : object ) -> bool : ...
40
44
41
45
# is_duration is only defined if isoduration is installed.
42
- def is_duration (instance ) -> bool : ...
43
- def is_uuid (instance ) -> bool : ...
46
+ def is_duration (instance : object ) -> bool : ...
47
+ def is_uuid (instance : object ) -> bool : ...
0 commit comments