3
3
4
4
# TODO: Remove this check once python 3.7 is not supported:
5
5
if sys .version_info >= (3 , 8 ):
6
- from typing import TYPE_CHECKING , TypedDict , Union
6
+ from typing import TYPE_CHECKING , Literal , TypedDict , Union
7
7
8
8
if TYPE_CHECKING :
9
9
try :
12
12
Colormap = str
13
13
14
14
class T_Options (TypedDict ):
15
- arithmetic_join : str
15
+ arithmetic_join : Literal [ "inner" , "outer" , "left" , "right" , "exact" ]
16
16
cmap_divergent : Union [str , "Colormap" ]
17
17
cmap_sequential : Union [str , "Colormap" ]
18
18
display_max_rows : int
19
- display_style : str
19
+ display_style : Literal [ "text" , "html" ]
20
20
display_width : int
21
- display_expand_attrs : Union [ str , bool ]
22
- display_expand_coords : Union [ str , bool ]
23
- display_expand_data_vars : Union [ str , bool ]
24
- display_expand_data : Union [ str , bool ]
21
+ display_expand_attrs : Literal [ "default" , True , False ]
22
+ display_expand_coords : Literal [ "default" , True , False ]
23
+ display_expand_data_vars : Literal [ "default" , True , False ]
24
+ display_expand_data : Literal [ "default" , True , False ]
25
25
enable_cftimeindex : bool
26
26
file_cache_maxsize : int
27
- keep_attrs : Union [ str , bool ]
27
+ keep_attrs : Literal [ "default" , True , False ]
28
28
warn_for_unclosed_files : bool
29
29
use_bottleneck : bool
30
30
@@ -34,7 +34,7 @@ class T_Options(TypedDict):
34
34
# `TypedDict` without requiring typing_extensions as a required dependency
35
35
# to _run_ the code (it is required to type-check).
36
36
try :
37
- from typing import TYPE_CHECKING , Union
37
+ from typing import TYPE_CHECKING , Literal , Union
38
38
39
39
from typing_extensions import TypedDict
40
40
@@ -45,19 +45,19 @@ class T_Options(TypedDict):
45
45
Colormap = str
46
46
47
47
class T_Options (TypedDict ):
48
- arithmetic_join : str
48
+ arithmetic_join : Literal [ "inner" , "outer" , "left" , "right" , "exact" ]
49
49
cmap_divergent : Union [str , "Colormap" ]
50
50
cmap_sequential : Union [str , "Colormap" ]
51
51
display_max_rows : int
52
- display_style : str
52
+ display_style : Literal [ "text" , "html" ]
53
53
display_width : int
54
- display_expand_attrs : Union [ str , bool ]
55
- display_expand_coords : Union [ str , bool ]
56
- display_expand_data_vars : Union [ str , bool ]
57
- display_expand_data : Union [ str , bool ]
54
+ display_expand_attrs : Literal [ "default" , True , False ]
55
+ display_expand_coords : Literal [ "default" , True , False ]
56
+ display_expand_data_vars : Literal [ "default" , True , False ]
57
+ display_expand_data : Literal [ "default" , True , False ]
58
58
enable_cftimeindex : bool
59
59
file_cache_maxsize : int
60
- keep_attrs : Union [ str , bool ]
60
+ keep_attrs : Literal [ "default" , True , False ]
61
61
warn_for_unclosed_files : bool
62
62
use_bottleneck : bool
63
63
0 commit comments