mirror of
https://github.com/python/cpython.git
synced 2026-06-27 19:36:07 +00:00
[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:
parent
415e218ed5
commit
4677e25714
4 changed files with 7 additions and 7 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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"}
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Make the type annotations in the private ``_colorize`` module resolvable.
|
||||
|
|
@ -0,0 +1 @@
|
|||
Make type annotations in the private ``_colorize`` module resolvable.
|
||||
Loading…
Add table
Add a link
Reference in a new issue