From 63a89dda114d362104e8c3dad7985d8720cf95e9 Mon Sep 17 00:00:00 2001 From: Nathan Walters Date: Thu, 23 Feb 2023 14:37:11 -0800 Subject: [PATCH 1/2] Pygments: fix get_style_by_name return type --- stubs/Pygments/pygments/styles/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/Pygments/pygments/styles/__init__.pyi b/stubs/Pygments/pygments/styles/__init__.pyi index 18906e415ab0..4f5a0facecbb 100644 --- a/stubs/Pygments/pygments/styles/__init__.pyi +++ b/stubs/Pygments/pygments/styles/__init__.pyi @@ -6,7 +6,7 @@ from pygments.util import ClassNotFound as ClassNotFound STYLE_MAP: Mapping[str, str] -def get_style_by_name(name) -> StyleMeta: ... +def get_style_by_name(name) -> type[StyleMeta]: ... def get_all_styles() -> Iterator[str]: ... # Having every style class here doesn't seem to be worth it From 1deb06c32be2ef39c9550f4cf7153b97f1bc2750 Mon Sep 17 00:00:00 2001 From: Nathan Walters Date: Thu, 23 Feb 2023 14:56:20 -0800 Subject: [PATCH 2/2] Return Style type instead --- stubs/Pygments/pygments/styles/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/Pygments/pygments/styles/__init__.pyi b/stubs/Pygments/pygments/styles/__init__.pyi index 4f5a0facecbb..77d42db8f586 100644 --- a/stubs/Pygments/pygments/styles/__init__.pyi +++ b/stubs/Pygments/pygments/styles/__init__.pyi @@ -1,12 +1,12 @@ from _typeshed import Incomplete from collections.abc import Iterator, Mapping -from pygments.style import StyleMeta +from pygments.style import Style from pygments.util import ClassNotFound as ClassNotFound STYLE_MAP: Mapping[str, str] -def get_style_by_name(name) -> type[StyleMeta]: ... +def get_style_by_name(name) -> type[Style]: ... def get_all_styles() -> Iterator[str]: ... # Having every style class here doesn't seem to be worth it