[3.15] gh-150994: _colorize: modernize typing imports (GH-151018) (#152041)

gh-150994: _colorize: modernize typing imports (GH-151018)
(cherry picked from commit fcda96fbf3)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Miss Islington (bot) 2026-06-24 05:27:00 +02:00 committed by GitHub
parent 415e218ed5
commit 4677e25714
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View file

@ -4,14 +4,12 @@
from collections.abc import Callable, Iterator, Mapping
from dataclasses import dataclass, field, Field
lazy from typing import IO, Literal, Self, ClassVar
COLORIZE = True
# types
if False:
from typing import IO, Literal, Self, ClassVar
_theme: Theme
_theme: Theme
type BackgroundStyle = Literal["dark", "light"]
class ANSIColors:
@ -319,7 +317,7 @@ class LiveProfiler(ThemeSection):
medal_bronze_fg: int = CursesColors.GREEN
# Background style: 'dark' or 'light'
background_style: Literal["dark", "light"] = "dark"
background_style: BackgroundStyle = "dark"
LiveProfilerLight = LiveProfiler(

View file

@ -28,7 +28,7 @@ class TestImportTime(unittest.TestCase):
@cpython_only
def test_lazy_import(self):
import_helper.ensure_lazy_imports(
"_colorize", {"copy", "re", "inspect"}
"_colorize", {"copy", "re", "inspect", "typing"}
)

View file

@ -0,0 +1 @@
Make the type annotations in the private ``_colorize`` module resolvable.

View file

@ -0,0 +1 @@
Make type annotations in the private ``_colorize`` module resolvable.