29
29
_VT = TypeVar ("_VT" )
30
30
31
31
32
- def adjoin (space : int , * lists : list [str ], ** kwargs ) -> str :
32
+ def adjoin (space : int , * lists : list [str ], ** kwargs : Any ) -> str :
33
33
"""
34
34
Glues together two sets of strings using the amount of space requested.
35
35
The idea is to prettify.
@@ -98,7 +98,7 @@ def _adj_justify(texts: Iterable[str], max_len: int, mode: str = "right") -> lis
98
98
99
99
100
100
def _pprint_seq (
101
- seq : Sequence , _nest_lvl : int = 0 , max_seq_items : int | None = None , ** kwds
101
+ seq : Sequence , _nest_lvl : int = 0 , max_seq_items : int | None = None , ** kwds : Any
102
102
) -> str :
103
103
"""
104
104
internal. pprinter for iterables. you should probably use pprint_thing()
@@ -136,7 +136,7 @@ def _pprint_seq(
136
136
137
137
138
138
def _pprint_dict (
139
- seq : Mapping , _nest_lvl : int = 0 , max_seq_items : int | None = None , ** kwds
139
+ seq : Mapping , _nest_lvl : int = 0 , max_seq_items : int | None = None , ** kwds : Any
140
140
) -> str :
141
141
"""
142
142
internal. pprinter for iterables. you should probably use pprint_thing()
@@ -240,7 +240,7 @@ def as_escaped_string(
240
240
241
241
242
242
def pprint_thing_encoded (
243
- object , encoding : str = "utf-8" , errors : str = "replace"
243
+ object : Any , encoding : str = "utf-8" , errors : str = "replace"
244
244
) -> bytes :
245
245
value = pprint_thing (object ) # get unicode representation of object
246
246
return value .encode (encoding , errors )
@@ -252,7 +252,7 @@ def enable_data_resource_formatter(enable: bool) -> None:
252
252
return
253
253
from IPython import get_ipython
254
254
255
- ip = get_ipython ()
255
+ ip = get_ipython () # type: ignore[no-untyped-call]
256
256
if ip is None :
257
257
# still not in IPython
258
258
return
@@ -289,7 +289,7 @@ def default_pprint(thing: Any, max_seq_items: int | None = None) -> str:
289
289
290
290
291
291
def format_object_summary (
292
- obj ,
292
+ obj : Any ,
293
293
formatter : Callable ,
294
294
is_justify : bool = True ,
295
295
name : str | None = None ,
@@ -525,7 +525,7 @@ def justify(self, texts: Any, max_len: int, mode: str = "right") -> list[str]:
525
525
else :
526
526
return [x .rjust (max_len ) for x in texts ]
527
527
528
- def adjoin (self , space : int , * lists , ** kwargs ) -> str :
528
+ def adjoin (self , space : int , * lists : Any , ** kwargs : Any ) -> str :
529
529
return adjoin (space , * lists , strlen = self .len , justfunc = self .justify , ** kwargs )
530
530
531
531
@@ -557,7 +557,7 @@ def justify(
557
557
self , texts : Iterable [str ], max_len : int , mode : str = "right"
558
558
) -> list [str ]:
559
559
# re-calculate padding space per str considering East Asian Width
560
- def _get_pad (t ) :
560
+ def _get_pad (t : str ) -> int :
561
561
return max_len - self .len (t ) + len (t )
562
562
563
563
if mode == "left" :
0 commit comments