1
- from typing import Any
1
+ from typing import Any , TypeVar
2
2
3
3
from pygments .formatter import Formatter
4
4
5
+ _T = TypeVar ("_T" , str , bytes )
6
+
5
7
class PilNotAvailable (ImportError ): ...
6
8
class FontNotFound (Exception ): ...
7
9
@@ -15,7 +17,7 @@ class FontManager:
15
17
def get_text_size (self , text ): ...
16
18
def get_font (self , bold , oblique ): ...
17
19
18
- class ImageFormatter (Formatter ):
20
+ class ImageFormatter (Formatter [ _T ] ):
19
21
name : str
20
22
aliases : Any
21
23
filenames : Any
@@ -42,23 +44,22 @@ class ImageFormatter(Formatter):
42
44
hl_lines : Any
43
45
hl_color : Any
44
46
drawables : Any
45
- def __init__ (self , ** options ) -> None : ...
46
47
def get_style_defs (self , arg : str = ...) -> None : ...
47
48
def format (self , tokensource , outfile ) -> None : ...
48
49
49
- class GifImageFormatter (ImageFormatter ):
50
+ class GifImageFormatter (ImageFormatter [ _T ] ):
50
51
name : str
51
52
aliases : Any
52
53
filenames : Any
53
54
default_image_format : str
54
55
55
- class JpgImageFormatter (ImageFormatter ):
56
+ class JpgImageFormatter (ImageFormatter [ _T ] ):
56
57
name : str
57
58
aliases : Any
58
59
filenames : Any
59
60
default_image_format : str
60
61
61
- class BmpImageFormatter (ImageFormatter ):
62
+ class BmpImageFormatter (ImageFormatter [ _T ] ):
62
63
name : str
63
64
aliases : Any
64
65
filenames : Any
0 commit comments