From 918fc22b70eb0f22b5e25385b4b5fbef6bfaf7ac Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 20:30:37 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.2 → v0.16.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.2...v0.16.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8bd8744..abf0fcf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: check-toml # Python - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.2 + rev: v0.16.0 hooks: - id: ruff args: [ --fix ] From ca06eaff8b9f493110d6eebeba56b454d0538d30 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 20:30:57 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- dargs/dargs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dargs/dargs.py b/dargs/dargs.py index f067b01..eab2733 100644 --- a/dargs/dargs.py +++ b/dargs/dargs.py @@ -58,7 +58,7 @@ class ArgumentError(Exception): """Base error class for invalid argument values in argchecking.""" def __init__( - self, path: None | str | list[str] = None, message: str | None = None + self, path: str | list[str] | None = None, message: str | None = None ) -> None: super().__init__(message) if path is None: @@ -142,7 +142,7 @@ class Argument: def __init__( self, name: str, - dtype: None | type | Iterable[type | Any | None], + dtype: type | Iterable[type | Any | None] | None, sub_fields: Iterable[Argument] | None = None, sub_variants: Iterable[Variant] | None = None, repeat: bool = False, @@ -222,7 +222,7 @@ def I(self) -> Argument: # noqa:E743 return Argument("_", dict, [self]) def _reorg_dtype( - self, dtype: None | type | Any | Iterable[type | Any | None] + self, dtype: type | Any | Iterable[type | Any | None] | None ) -> tuple[type | Any | None, ...]: if ( isinstance(dtype, type) @@ -258,7 +258,7 @@ def _reorg_dtype( # and make it compatible with `isinstance` return tuple(dtype) - def set_dtype(self, dtype: None | type | Iterable[type]) -> None: + def set_dtype(self, dtype: type | Iterable[type] | None) -> None: """Change the dtype of the current Argument.""" self.dtype = self._reorg_dtype(dtype) @@ -866,7 +866,7 @@ def extend_choices(self, choices: Iterable[Argument] | None) -> None: def add_choice( self, tag: str | Argument, - _dtype: None | type | Iterable[type] = dict, + _dtype: type | Iterable[type] | None = dict, *args: Any, **kwargs: Any, ) -> Argument: