summaryrefslogtreecommitdiffstats
path: root/ptpython/style.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:40:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:40:00 +0000
commite0719babdc8744144449c81fac14ba7bbf21446f (patch)
tree36e17925ec537746a9bb1ce7035b216529a957a5 /ptpython/style.py
parentReleasing debian version 3.0.22-2. (diff)
downloadptpython-e0719babdc8744144449c81fac14ba7bbf21446f.tar.xz
ptpython-e0719babdc8744144449c81fac14ba7bbf21446f.zip
Merging upstream version 3.0.23.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ptpython/style.py')
-rw-r--r--ptpython/style.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ptpython/style.py b/ptpython/style.py
index 4b54d0c..199d5ab 100644
--- a/ptpython/style.py
+++ b/ptpython/style.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
from typing import Dict
from prompt_toolkit.styles import BaseStyle, Style, merge_styles
@@ -8,11 +10,11 @@ from pygments.styles import get_all_styles, get_style_by_name
__all__ = ["get_all_code_styles", "get_all_ui_styles", "generate_style"]
-def get_all_code_styles() -> Dict[str, BaseStyle]:
+def get_all_code_styles() -> dict[str, BaseStyle]:
"""
Return a mapping from style names to their classes.
"""
- result: Dict[str, BaseStyle] = {
+ result: dict[str, BaseStyle] = {
name: style_from_pygments_cls(get_style_by_name(name))
for name in get_all_styles()
}
@@ -20,7 +22,7 @@ def get_all_code_styles() -> Dict[str, BaseStyle]:
return result
-def get_all_ui_styles() -> Dict[str, BaseStyle]:
+def get_all_ui_styles() -> dict[str, BaseStyle]:
"""
Return a dict mapping {ui_style_name -> style_dict}.
"""