[llvm] [lit] Add type hints to formats (PR #201583)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 06:49:24 PDT 2026
================
@@ -1,11 +1,24 @@
+from __future__ import annotations
+
import os
+from typing import TYPE_CHECKING, Iterator, Tuple, Union
import lit.Test
import lit.util
+if TYPE_CHECKING:
----------------
prasoon054 wrote:
These can't be imported unconditionally. It creates a circular import. `LitConfig.py` imports `lit.formats` (for the format classes), and `lit/formats/__init__.py` imports `base/googletest/shtest`. So a top-level `from lit.LitConfig import LitConfig` in any of these modules lcloses the cycle.
https://github.com/llvm/llvm-project/pull/201583
More information about the llvm-commits
mailing list