reykit 1.1.0__py3-none-any.whl → 1.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
reykit/ros.py CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
 
12
12
  from __future__ import annotations
13
- from typing import Any, Union, Literal, Optional, NoReturn, overload
13
+ from typing import Any, Literal, NoReturn, overload
14
14
  from io import TextIOBase, BufferedIOBase
15
15
  from os import (
16
16
  walk as os_walk,
@@ -76,12 +76,12 @@ __all__ = (
76
76
  type FilePath = str
77
77
  type FileText = str
78
78
  type FileData = bytes
79
- type FileStr = Union[FilePath, FileText, TextIOBase]
80
- type FileBytes = Union[FilePath, FileData, BufferedIOBase]
81
- type File = Union[FileStr, FileBytes]
79
+ type FileStr = FilePath | FileText | TextIOBase
80
+ type FileBytes = FilePath | FileData | BufferedIOBase
81
+ type File = FileStr | FileBytes
82
82
 
83
83
 
84
- def get_md5(file: Union[str, bytes]) -> str:
84
+ def get_md5(file: str | bytes) -> str:
85
85
  """
86
86
  Get file MD5.
87
87
 
@@ -265,7 +265,7 @@ def get_file_bytes(file: FileBytes) -> bytes:
265
265
  return file_bytes
266
266
 
267
267
 
268
- def read_toml(path: Union[str, RFile]) -> dict[str, Any]:
268
+ def read_toml(path: str | RFile) -> dict[str, Any]:
269
269
  """
270
270
  Read and parse TOML file.
271
271
  Treat nan as a None or null value.
@@ -338,7 +338,7 @@ class RFile(object):
338
338
  def read(
339
339
  self,
340
340
  type_: Literal['str', 'bytes'] = 'bytes'
341
- ) -> Union[bytes, str]:
341
+ ) -> bytes | str:
342
342
  """
343
343
  Read file data.
344
344
 
@@ -371,7 +371,7 @@ class RFile(object):
371
371
 
372
372
  def write(
373
373
  self,
374
- data: Optional[Any] = '',
374
+ data: Any | None = '',
375
375
  append: bool = False
376
376
  ) -> None:
377
377
  """
@@ -735,7 +735,7 @@ class RFile(object):
735
735
 
736
736
  def __contains__(
737
737
  self,
738
- value: Union[str, bytes]
738
+ value: str | bytes
739
739
  ) -> bool:
740
740
  """
741
741
  Judge if file text contain value.
@@ -775,7 +775,7 @@ class RFolder(object):
775
775
 
776
776
  def __init__(
777
777
  self,
778
- path: Optional[str] = None
778
+ path: str | None = None
779
779
  ) -> None:
780
780
  """
781
781
  Build `folder` attributes.
@@ -873,7 +873,7 @@ class RFolder(object):
873
873
  pattern: str,
874
874
  recursion: bool = False,
875
875
  all_ : Literal[False] = False
876
- ) -> Optional[str]: ...
876
+ ) -> str | None: ...
877
877
 
878
878
  @overload
879
879
  def search(
@@ -888,7 +888,7 @@ class RFolder(object):
888
888
  pattern: str,
889
889
  recursion: bool = False,
890
890
  all_ : bool = False
891
- ) -> Optional[str]:
891
+ ) -> str | None:
892
892
  """
893
893
  Search file by name.
894
894
 
@@ -1149,8 +1149,8 @@ class RTempFile(object):
1149
1149
 
1150
1150
  def __init__(
1151
1151
  self,
1152
- dir_: Optional[str] = None,
1153
- suffix: Optional[str] = None,
1152
+ dir_: str | None = None,
1153
+ suffix: str | None = None,
1154
1154
  type_: Literal['str', 'bytes'] = 'bytes'
1155
1155
  ) -> None:
1156
1156
  """
@@ -1181,7 +1181,7 @@ class RTempFile(object):
1181
1181
  self.path = self.file.name
1182
1182
 
1183
1183
 
1184
- def read(self) -> Union[bytes, str]:
1184
+ def read(self) -> bytes | str:
1185
1185
  """
1186
1186
  Read file data.
1187
1187
 
@@ -1199,7 +1199,7 @@ class RTempFile(object):
1199
1199
 
1200
1200
  def write(
1201
1201
  self,
1202
- data: Union[str, bytes]
1202
+ data: str | bytes
1203
1203
  ) -> None:
1204
1204
  """
1205
1205
  Write file data.
@@ -1391,7 +1391,7 @@ class RTempFile(object):
1391
1391
 
1392
1392
  def __contains__(
1393
1393
  self,
1394
- value: Union[str, bytes]
1394
+ value: str | bytes
1395
1395
  ) -> bool:
1396
1396
  """
1397
1397
  Judge if file text contain value.
@@ -1434,7 +1434,7 @@ class RTempFolder(object):
1434
1434
 
1435
1435
  def __init__(
1436
1436
  self,
1437
- dir_: Optional[str] = None
1437
+ dir_: str | None = None
1438
1438
  ) -> None:
1439
1439
  """
1440
1440
  Build `temporary folder` attributes.
@@ -1529,7 +1529,7 @@ class RTempFolder(object):
1529
1529
  pattern: str,
1530
1530
  recursion: bool = False,
1531
1531
  all_ : Literal[False] = False
1532
- ) -> Optional[str]: ...
1532
+ ) -> str | None: ...
1533
1533
 
1534
1534
  @overload
1535
1535
  def search(
@@ -1544,7 +1544,7 @@ class RTempFolder(object):
1544
1544
  pattern: str,
1545
1545
  recursion: bool = False,
1546
1546
  all_ : bool = False
1547
- ) -> Optional[str]:
1547
+ ) -> str | None:
1548
1548
  """
1549
1549
  Search file by name.
1550
1550
 
@@ -1762,7 +1762,7 @@ class RTempFolder(object):
1762
1762
 
1763
1763
  def doc_to_docx(
1764
1764
  path: str,
1765
- save_path: Optional[str] = None
1765
+ save_path: str | None = None
1766
1766
  ) -> str:
1767
1767
  """
1768
1768
  Convert `DOC` file to `DOCX` file.
reykit/rrandom.py CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
 
12
12
  from __future__ import annotations
13
- from typing import Union, Optional, Literal, Self, overload
13
+ from typing import Literal, Self, overload
14
14
  from types import TracebackType
15
15
  from collections.abc import Sequence
16
16
  from string import digits as string_digits, ascii_letters as string_ascii_letters, punctuation as string_punctuation
@@ -64,7 +64,7 @@ class RRandomSeed(object):
64
64
  """
65
65
 
66
66
 
67
- def __init__(self, seed: Optional[Union[int, float, str, bytes, bytearray]] = None) -> None:
67
+ def __init__(self, seed: int | float | str | bytes | bytearray | None = None) -> None:
68
68
  """
69
69
  Build `random` attributes.
70
70
 
@@ -72,7 +72,7 @@ class RRandomSeed(object):
72
72
  ----------
73
73
  seed : Random seed.
74
74
  - `None`: Clear seed.
75
- - `Union[int, float, str, bytes, bytearray]` : Set seed.
75
+ - `int | float | str | bytes | bytearray` : Set seed.
76
76
  """
77
77
 
78
78
  # Delete.
@@ -114,9 +114,9 @@ class RRandomSeed(object):
114
114
 
115
115
  def __exit__(
116
116
  self,
117
- exc_type: Optional[type[BaseException]],
118
- exc_instance: Optional[BaseException],
119
- exc_traceback: Optional[TracebackType]
117
+ exc_type: type[BaseException] | None,
118
+ exc_instance: BaseException | None,
119
+ exc_traceback: TracebackType | None
120
120
  ) -> None:
121
121
  """
122
122
  Exit syntax `with`.
@@ -158,8 +158,8 @@ def randn(
158
158
 
159
159
  def randn(
160
160
  *thresholds: float,
161
- precision: Optional[int] = None
162
- ) -> Union[int, float]:
161
+ precision: int | None = None
162
+ ) -> int | float:
163
163
  """
164
164
  Random number.
165
165
 
@@ -273,9 +273,9 @@ def randi(
273
273
 
274
274
  def randi(
275
275
  data: Sequence,
276
- multi: Optional[int] = None,
276
+ multi: int | None = None,
277
277
  unique: bool = True
278
- ) -> Union[Element, list[Element]]:
278
+ ) -> Element | list[Element]:
279
279
  """
280
280
  Random index data element.
281
281
 
reykit/rregex.py CHANGED
@@ -9,7 +9,7 @@
9
9
  """
10
10
 
11
11
 
12
- from typing import Optional, Union, Literal, overload
12
+ from typing import Literal, overload
13
13
  from collections.abc import Callable
14
14
  from re import (
15
15
  search as re_search,
@@ -38,7 +38,7 @@ __all__ = (
38
38
  def search(
39
39
  pattern: str,
40
40
  text: str
41
- ) -> Optional[Union[str, tuple[Optional[str], ...]]]:
41
+ ) -> str | tuple[str | None, ...] | None:
42
42
  """
43
43
  Regular search text.
44
44
 
@@ -73,7 +73,7 @@ def search(
73
73
  def findall(
74
74
  pattern: str,
75
75
  text: str,
76
- ) -> Union[list[str], list[tuple[str, ...]]]:
76
+ ) -> list[str] | list[tuple[str, ...]]:
77
77
  """
78
78
  Regular find all text.
79
79
 
@@ -96,8 +96,8 @@ def findall(
96
96
  def sub(
97
97
  pattern: str,
98
98
  text: str,
99
- replace: Optional[Union[str, Callable[[RMatch], str]]] = None,
100
- count: Optional[int] = None
99
+ replace: str | Callable[[RMatch], str] | None = None,
100
+ count: int | None = None
101
101
  ) -> str:
102
102
  """
103
103
  Regular replace text.
@@ -130,7 +130,7 @@ def sub(
130
130
  def split(
131
131
  pattern: str,
132
132
  text: str,
133
- count: Optional[int] = None
133
+ count: int | None = None
134
134
  ) -> list[str]:
135
135
  """
136
136
  Regular split text.
@@ -161,23 +161,20 @@ def search_batch(
161
161
  text: str,
162
162
  *patterns: str,
163
163
  first: Literal[True] = True
164
- ) -> Optional[Union[str, tuple[Optional[str], ...]]]: ...
164
+ ) -> str | tuple[str | None, ...] | None: ...
165
165
 
166
166
  @overload
167
167
  def search_batch(
168
168
  text: str,
169
169
  *patterns: str,
170
170
  first: Literal[False] = True
171
- ) -> list[Optional[Union[str, tuple[Optional[str], ...]]]]: ...
171
+ ) -> list[str | tuple[str | None, ...] | None]: ...
172
172
 
173
173
  def search_batch(
174
174
  text: str,
175
175
  *patterns: str,
176
176
  first: bool = True
177
- ) -> Union[
178
- Optional[Union[str, tuple[Optional[str], ...]]],
179
- list[Optional[Union[str, tuple[Optional[str], ...]]]]
180
- ]:
177
+ ) -> str | tuple[str | None, ...] | list[str | tuple[str | None, ...] | None] | None:
181
178
  """
182
179
  Batch regular search text.
183
180
 
@@ -237,7 +234,7 @@ def findall_batch(text: str, *patterns: str) -> str:
237
234
  return texts
238
235
 
239
236
 
240
- def sub_batch(text: str, *patterns: Union[str, tuple[str, Union[str, Callable[[RMatch], str]]]]) -> str:
237
+ def sub_batch(text: str, *patterns: str | tuple[str, str | Callable[[RMatch], str]]) -> str:
241
238
  """
242
239
  Batch regular replace text.
243
240
 
reykit/rschedule.py CHANGED
@@ -9,7 +9,7 @@
9
9
  """
10
10
 
11
11
 
12
- from typing import Any, Literal, Union, Optional
12
+ from typing import Any, Literal
13
13
  from collections.abc import Callable
14
14
  from apscheduler.executors.pool import ThreadPoolExecutor
15
15
  from apscheduler.schedulers.background import BackgroundScheduler
@@ -123,8 +123,8 @@ class RSchedule(object):
123
123
  self,
124
124
  func: Callable,
125
125
  trigger: Literal['date', 'interval', 'cron'] = 'date',
126
- args: Optional[tuple] = None,
127
- kwargs: Optional[dict] = None,
126
+ args: tuple | None = None,
127
+ kwargs: dict | None = None,
128
128
  **trigger_kwargs: Any
129
129
  ) -> Job:
130
130
  """
@@ -157,10 +157,10 @@ class RSchedule(object):
157
157
 
158
158
  def modify_task(
159
159
  self,
160
- task: Union[Job, str],
161
- trigger: Optional[Literal['date', 'interval', 'cron']] = None,
162
- args: Optional[tuple] = None,
163
- kwargs: Optional[dict] = None,
160
+ task: Job | str,
161
+ trigger: Literal['date', 'interval', 'cron'] | None = None,
162
+ args: tuple | None = None,
163
+ kwargs: dict | None = None,
164
164
  **trigger_kwargs: Any
165
165
  ) -> None:
166
166
  """
@@ -205,7 +205,7 @@ class RSchedule(object):
205
205
 
206
206
  def remove_task(
207
207
  self,
208
- task: Union[Job, str]
208
+ task: Job | str
209
209
  ) -> None:
210
210
  """
211
211
  Remove task.
@@ -227,7 +227,7 @@ class RSchedule(object):
227
227
 
228
228
  def pause_task(
229
229
  self,
230
- task: Union[Job, str]
230
+ task: Job | str
231
231
  ) -> None:
232
232
  """
233
233
  Pause task.
@@ -249,7 +249,7 @@ class RSchedule(object):
249
249
 
250
250
  def resume_task(
251
251
  self,
252
- task: Union[Job, str]
252
+ task: Job | str
253
253
  ) -> None:
254
254
  """
255
255
  Resume task.
reykit/rstdout.py CHANGED
@@ -9,7 +9,7 @@
9
9
  """
10
10
 
11
11
 
12
- from typing import Any, Literal, Optional, Union, Final, Self
12
+ from typing import Any, Literal, Final, Self
13
13
  from collections.abc import Callable
14
14
  import sys
15
15
  from io import TextIOWrapper
@@ -60,9 +60,9 @@ class RConfigStdout(object, metaclass=RConfigMeta):
60
60
 
61
61
  def beautify_text(
62
62
  data: tuple[Any],
63
- title: Union[bool, str] = True,
64
- width: Optional[int] = None,
65
- frame: Optional[Literal['full', 'half', 'top', 'half_plain', 'top_plain']] = 'full'
63
+ title: bool | str = True,
64
+ width: int | None = None,
65
+ frame: Literal['full', 'half', 'top', 'half_plain', 'top_plain'] | None = 'full'
66
66
  ) -> str:
67
67
  """
68
68
  Beautify data to text.
@@ -132,9 +132,9 @@ def beautify_text(
132
132
 
133
133
  def echo(
134
134
  *data: Any,
135
- title: Union[bool, str] = True,
136
- width: Optional[int] = None,
137
- frame: Optional[Literal['full', 'half', 'top', 'half_plain', 'top_plain']] = 'full'
135
+ title: bool | str = True,
136
+ width: int | None = None,
137
+ frame: Literal['full', 'half', 'top', 'half_plain', 'top_plain'] | None = 'full'
138
138
  ) -> str:
139
139
  """
140
140
  Beautify data to text, and print.
@@ -176,10 +176,10 @@ def echo(
176
176
 
177
177
  def rinput(
178
178
  *data: Any,
179
- title: Union[bool, str] = True,
180
- width: Optional[int] = None,
181
- frame: Optional[Literal['full', 'half', 'top', 'half_plain', 'top_plain']] = 'full',
182
- extra: Optional[str] = None
179
+ title: bool | str = True,
180
+ width: int | None = None,
181
+ frame: Literal['full', 'half', 'top', 'half_plain', 'top_plain'] | None = 'full',
182
+ extra: str | None = None
183
183
  ) -> str:
184
184
  """
185
185
  Beautify data to text, and print data, and read string from standard input.
@@ -251,7 +251,7 @@ def start_print() -> None:
251
251
  RConfigStdout._stoped = False
252
252
 
253
253
 
254
- def modify_print(preprocess: Callable[[str], Optional[str]]) -> None:
254
+ def modify_print(preprocess: Callable[[str], str] | None) -> None:
255
255
  """
256
256
  Modify standard output print write method.
257
257
 
@@ -264,7 +264,7 @@ def modify_print(preprocess: Callable[[str], Optional[str]]) -> None:
264
264
 
265
265
 
266
266
  # Define.
267
- def write(__s: str) -> Optional[int]:
267
+ def write(__s: str) -> int | None:
268
268
  """
269
269
  Modified standard output write method.
270
270
 
reykit/rsystem.py CHANGED
@@ -9,7 +9,7 @@
9
9
  """
10
10
 
11
11
 
12
- from typing import Any, TypedDict, Literal, Optional, Union, overload
12
+ from typing import Any, TypedDict, Literal, overload
13
13
  from collections.abc import Callable, Iterable, Sequence
14
14
  from inspect import signature as inspect_signature, _ParameterKind, _empty
15
15
  from sys import path as sys_path, modules as sys_modules
@@ -110,17 +110,17 @@ ComputerInfo = TypedDict(
110
110
  NetWorkInfo = TypedDict(
111
111
  'NetWorkTable',
112
112
  {
113
- 'family': Optional[str],
114
- 'socket': Optional[str],
113
+ 'family': str | None,
114
+ 'socket': str | None,
115
115
  'local_ip': str,
116
116
  'local_port': int,
117
- 'remote_ip': Optional[str],
118
- 'remote_port': Optional[int],
119
- 'status': Optional[str],
120
- 'pid': Optional[int]
117
+ 'remote_ip': str | None,
118
+ 'remote_port': int | None,
119
+ 'status': str | None,
120
+ 'pid': int | None
121
121
  }
122
122
  )
123
- ProcessInfo = TypedDict('ProcessInfo', {'create_time': datetime, 'id': int, 'name': str, 'ports': Optional[list[int]]})
123
+ ProcessInfo = TypedDict('ProcessInfo', {'create_time': datetime, 'id': int, 'name': str, 'ports': list[int] | None})
124
124
 
125
125
 
126
126
  class RConfigSystem(object, metaclass=RConfigMeta):
@@ -208,7 +208,7 @@ def del_modules(path: str) -> list[str]:
208
208
  return deleted_dict
209
209
 
210
210
 
211
- def dos_command(command: Union[str, Iterable[str]]) -> str:
211
+ def dos_command(command: str | Iterable[str]) -> str:
212
212
  """
213
213
  Execute DOS command.
214
214
 
@@ -444,7 +444,7 @@ def is_number_str(
444
444
 
445
445
  def get_first_notnull(
446
446
  *values: Any,
447
- default: Union[None, Any, Literal['exception']] = None,
447
+ default: Any | Literal['exception'] | None = None,
448
448
  nulls: tuple = (None,)) -> Any:
449
449
  """
450
450
  Get the first value that is not null.
@@ -482,12 +482,12 @@ def get_first_notnull(
482
482
 
483
483
 
484
484
  @overload
485
- def get_name(obj: tuple, frame: int = 2) -> Optional[tuple[str, ...]]: ...
485
+ def get_name(obj: tuple, frame: int = 2) -> tuple[str, ...] | None: ...
486
486
 
487
487
  @overload
488
- def get_name(obj: Any, frame: int = 2) -> Optional[str]: ...
488
+ def get_name(obj: Any, frame: int = 2) -> str | None: ...
489
489
 
490
- def get_name(obj: Any, frame: int = 2) -> Optional[Union[str, tuple[str, ...]]]:
490
+ def get_name(obj: Any, frame: int = 2) -> str | tuple[str, ...] | None:
491
491
  """
492
492
  Get name of object or variable.
493
493
 
@@ -588,7 +588,7 @@ def get_stack_param(format_: Literal['floor'] = 'floor', limit: int = 2) -> dict
588
588
  @overload
589
589
  def get_stack_param(format_: Literal['full'] = 'floor', limit: int = 2) -> list[dict]: ...
590
590
 
591
- def get_stack_param(format_: Literal['floor', 'full'] = 'floor', limit: int = 2) -> Union[dict, list[dict]]:
591
+ def get_stack_param(format_: Literal['floor', 'full'] = 'floor', limit: int = 2) -> dict | list[dict]:
592
592
  """
593
593
  Get code stack parameters.
594
594
 
@@ -644,7 +644,7 @@ def get_stack_param(format_: Literal['floor', 'full'] = 'floor', limit: int = 2)
644
644
  def get_arg_info(func: Callable) -> list[
645
645
  dict[
646
646
  Literal['name', 'type', 'annotation', 'default'],
647
- Optional[str]
647
+ str | None
648
648
  ]
649
649
  ]:
650
650
  """
@@ -890,9 +890,9 @@ def get_process_table() -> list[ProcessInfo]:
890
890
 
891
891
 
892
892
  def search_process(
893
- id_: Optional[Union[int, Sequence[int]]] = None,
894
- name: Optional[Union[str, Sequence[str]]] = None,
895
- port: Optional[Union[str, int, Sequence[Union[str, int]]]] = None,
893
+ id_: int | Sequence[int] | None = None,
894
+ name: str | Sequence[str] | None = None,
895
+ port: str | int | Sequence[str | int] | None = None,
896
896
  ) -> list[Process]:
897
897
  """
898
898
  Search process by ID or name or port.
@@ -976,9 +976,9 @@ def search_process(
976
976
 
977
977
 
978
978
  def kill_process(
979
- id_: Optional[Union[int, Sequence[int]]] = None,
980
- name: Optional[Union[str, Sequence[str]]] = None,
981
- port: Optional[Union[str, int, Sequence[Union[str, int]]]] = None,
979
+ id_: int | Sequence[int] | None = None,
980
+ name: str | Sequence[str] | None = None,
981
+ port: str | int | Sequence[str | int] | None = None,
982
982
  ) -> list[Process]:
983
983
  """
984
984
  Search and kill process by ID or name or port.
@@ -1014,9 +1014,9 @@ def kill_process(
1014
1014
 
1015
1015
 
1016
1016
  def stop_process(
1017
- id_: Optional[Union[int, Sequence[int]]] = None,
1018
- name: Optional[Union[str, Sequence[str]]] = None,
1019
- port: Optional[Union[str, int, Sequence[Union[str, int]]]] = None,
1017
+ id_: int | Sequence[int] | None = None,
1018
+ name: str | Sequence[str] | None = None,
1019
+ port: str | int | Sequence[str | int] | None = None,
1020
1020
  ) -> list[Process]:
1021
1021
  """
1022
1022
  Search and stop process by ID or name or port.
@@ -1052,9 +1052,9 @@ def stop_process(
1052
1052
 
1053
1053
 
1054
1054
  def start_process(
1055
- id_: Optional[Union[int, Sequence[int]]] = None,
1056
- name: Optional[Union[str, Sequence[str]]] = None,
1057
- port: Optional[Union[str, int, Sequence[Union[str, int]]]] = None,
1055
+ id_: int | Sequence[int] | None = None,
1056
+ name: str | Sequence[str] | None = None,
1057
+ port: str | int | Sequence[str | int] | None = None,
1058
1058
  ) -> list[Process]:
1059
1059
  """
1060
1060
  Search and start process by ID or name or port.
@@ -1110,7 +1110,7 @@ def get_idle_port(min: int = 49152) -> int:
1110
1110
 
1111
1111
 
1112
1112
  def memory_read(
1113
- process: Union[int, str],
1113
+ process: int | str,
1114
1114
  dll: str,
1115
1115
  offset: int
1116
1116
  ) -> int:
@@ -1149,7 +1149,7 @@ def memory_read(
1149
1149
 
1150
1150
 
1151
1151
  def memory_write(
1152
- process: Union[int, str],
1152
+ process: int | str,
1153
1153
  dll: str,
1154
1154
  offset: int,
1155
1155
  value: int
@@ -1200,8 +1200,8 @@ def open_browser(url: str) -> bool:
1200
1200
 
1201
1201
  def popup_message(
1202
1202
  style: Literal['info', 'warn', 'error'] = 'info',
1203
- message: Optional[str] = None,
1204
- title: Optional[str] = None
1203
+ message: str | None = None,
1204
+ title: str | None = None
1205
1205
  ) -> None:
1206
1206
  """
1207
1207
  Pop up system message box.
@@ -1237,22 +1237,22 @@ def popup_message(
1237
1237
  @overload
1238
1238
  def popup_ask(
1239
1239
  style: Literal['yes_no_cancel'] = 'yes_no',
1240
- message: Optional[str] = None,
1241
- title: Optional[str] = None
1242
- ) -> Optional[bool]: ...
1240
+ message: str | None = None,
1241
+ title: str | None = None
1242
+ ) -> bool | None: ...
1243
1243
 
1244
1244
  @overload
1245
1245
  def popup_ask(
1246
1246
  style: Literal['yes_no', 'ok_cancel', 'retry_cancel'] = 'yes_no',
1247
- message: Optional[str] = None,
1248
- title: Optional[str] = None
1247
+ message: str | None = None,
1248
+ title: str | None = None
1249
1249
  ) -> bool: ...
1250
1250
 
1251
1251
  def popup_ask(
1252
1252
  style: Literal['yes_no', 'ok_cancel', 'retry_cancel', 'yes_no_cancel'] = 'yes_no',
1253
- message: Optional[str] = None,
1254
- title: Optional[str] = None
1255
- ) -> Optional[bool]:
1253
+ message: str | None = None,
1254
+ title: str | None = None
1255
+ ) -> bool | None:
1256
1256
  """
1257
1257
  Pop up system ask box.
1258
1258
 
@@ -1292,35 +1292,35 @@ def popup_ask(
1292
1292
  @overload
1293
1293
  def popup_select(
1294
1294
  style: Literal['file', 'save'] = 'file',
1295
- title : Optional[str] = None,
1296
- init_folder : Optional[str] = None,
1297
- init_file : Optional[str] = None,
1298
- filter_file : Optional[list[tuple[str, str | list[str]]]] = None
1295
+ title : str | None = None,
1296
+ init_folder : str | None = None,
1297
+ init_file : str | None = None,
1298
+ filter_file : list[tuple[str, str | list[str]]] | None = None
1299
1299
  ) -> str: ...
1300
1300
 
1301
1301
  @overload
1302
1302
  def popup_select(
1303
1303
  style: Literal['files'] = 'file',
1304
- title : Optional[str] = None,
1305
- init_folder : Optional[str] = None,
1306
- init_file : Optional[str] = None,
1307
- filter_file : Optional[list[tuple[str, str | list[str]]]] = None
1304
+ title : str | None = None,
1305
+ init_folder : str | None = None,
1306
+ init_file : str | None = None,
1307
+ filter_file : list[tuple[str, str | list[str]]] | None = None
1308
1308
  ) -> tuple[str, ...]: ...
1309
1309
 
1310
1310
  @overload
1311
1311
  def popup_select(
1312
1312
  style: Literal['folder'] = 'file',
1313
- title : Optional[str] = None,
1314
- init_folder : Optional[str] = None
1313
+ title : str | None = None,
1314
+ init_folder : str | None = None
1315
1315
  ) -> str: ...
1316
1316
 
1317
1317
  def popup_select(
1318
1318
  style: Literal['file', 'files', 'folder', 'save'] = 'file',
1319
- title : Optional[str] = None,
1320
- init_folder : Optional[str] = None,
1321
- init_file : Optional[str] = None,
1322
- filter_file : Optional[list[tuple[str, str | list[str]]]] = None
1323
- ) -> Union[str, tuple[str, ...]]:
1319
+ title : str | None = None,
1320
+ init_folder : str | None = None,
1321
+ init_file : str | None = None,
1322
+ filter_file : list[tuple[str, str | list[str]]] | None = None
1323
+ ) -> str | tuple[str, ...]:
1324
1324
  """
1325
1325
  Pop up system select box.
1326
1326