From fe89b60b80a304a81643b82b734d89341cb116df Mon Sep 17 00:00:00 2001 From: Jose Drowne Date: Sat, 31 Jan 2026 01:12:50 -0500 Subject: [PATCH] Move IndexType alias inside TYPE_CHECKING block Co-Authored-By: Claude Opus 4.5 --- plugins/modules/toml_file.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/modules/toml_file.py b/plugins/modules/toml_file.py index d9124b8016..939972e77b 100644 --- a/plugins/modules/toml_file.py +++ b/plugins/modules/toml_file.py @@ -304,8 +304,9 @@ class TomlFileError(Exception): pass -# Type alias for array-of-tables index (int for position, "append" for new entry, None for default) -IndexType = t.Union[int, t.Literal["append"], None] # noqa: UP007 (Python 3.8/3.9 compat) +if t.TYPE_CHECKING: + # Type alias for array-of-tables index (int for position, "append" for new entry, None for default) + IndexType = t.Union[int, t.Literal["append"], None] # noqa: UP007 @dataclass