Skip to content

Commit ca06eaf

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 918fc22 commit ca06eaf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

dargs/dargs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ArgumentError(Exception):
5858
"""Base error class for invalid argument values in argchecking."""
5959

6060
def __init__(
61-
self, path: None | str | list[str] = None, message: str | None = None
61+
self, path: str | list[str] | None = None, message: str | None = None
6262
) -> None:
6363
super().__init__(message)
6464
if path is None:
@@ -142,7 +142,7 @@ class Argument:
142142
def __init__(
143143
self,
144144
name: str,
145-
dtype: None | type | Iterable[type | Any | None],
145+
dtype: type | Iterable[type | Any | None] | None,
146146
sub_fields: Iterable[Argument] | None = None,
147147
sub_variants: Iterable[Variant] | None = None,
148148
repeat: bool = False,
@@ -222,7 +222,7 @@ def I(self) -> Argument: # noqa:E743
222222
return Argument("_", dict, [self])
223223

224224
def _reorg_dtype(
225-
self, dtype: None | type | Any | Iterable[type | Any | None]
225+
self, dtype: type | Any | Iterable[type | Any | None] | None
226226
) -> tuple[type | Any | None, ...]:
227227
if (
228228
isinstance(dtype, type)
@@ -258,7 +258,7 @@ def _reorg_dtype(
258258
# and make it compatible with `isinstance`
259259
return tuple(dtype)
260260

261-
def set_dtype(self, dtype: None | type | Iterable[type]) -> None:
261+
def set_dtype(self, dtype: type | Iterable[type] | None) -> None:
262262
"""Change the dtype of the current Argument."""
263263
self.dtype = self._reorg_dtype(dtype)
264264

@@ -866,7 +866,7 @@ def extend_choices(self, choices: Iterable[Argument] | None) -> None:
866866
def add_choice(
867867
self,
868868
tag: str | Argument,
869-
_dtype: None | type | Iterable[type] = dict,
869+
_dtype: type | Iterable[type] | None = dict,
870870
*args: Any,
871871
**kwargs: Any,
872872
) -> Argument:

0 commit comments

Comments
 (0)