3737from itertools import takewhile
3838from pathlib import Path
3939from types import ModuleType , TracebackType
40- from typing import cast , List , Tuple , Any , Optional , Type , Union , MutableMapping , Callable , Dict
40+ from typing import (
41+ cast ,
42+ List ,
43+ Tuple ,
44+ Any ,
45+ Optional ,
46+ Type ,
47+ Union ,
48+ MutableMapping ,
49+ Callable ,
50+ Dict ,
51+ )
4152from ._typing_compat import Literal
4253
4354from pygments .lexers import Python3Lexer
@@ -93,7 +104,11 @@ class Interpreter(code.InteractiveInterpreter):
93104
94105 bpython_input_re = LazyReCompile (r"<bpython-input-\d+>" )
95106
96- def __init__ (self , locals : Optional [MutableMapping [str , str ]] = None , encoding : Optional [str ] = None ):
107+ def __init__ (
108+ self ,
109+ locals : Optional [MutableMapping [str , str ]] = None ,
110+ encoding : Optional [str ] = None ,
111+ ):
97112 """Constructor.
98113
99114 The optional 'locals' argument specifies the dictionary in which code
@@ -423,14 +438,18 @@ def __init__(self, interp: Interpreter, config: Config):
423438 # all input and output, stored as old style format strings
424439 # (\x01, \x02, ...) for cli.py
425440 self .screen_hist : List [str ] = []
426- self .history : List [str ] = [] # commands executed since beginning of session
441+ self .history : List [
442+ str
443+ ] = [] # commands executed since beginning of session
427444 self .redo_stack : List [str ] = []
428445 self .evaluating = False
429446 self .matches_iter = MatchesIterator ()
430447 self .funcprops = None
431448 self .arg_pos : Union [str , int , None ] = None
432449 self .current_func = None
433- self .highlighted_paren : Optional [Tuple [Any , List [Tuple [_TokenType , str ]]]] = None
450+ self .highlighted_paren : Optional [
451+ Tuple [Any , List [Tuple [_TokenType , str ]]]
452+ ] = None
434453 self ._C : Dict [str , int ] = {}
435454 self .prev_block_finished : int = 0
436455 self .interact = Interaction (self .config )
@@ -447,7 +466,8 @@ def __init__(self, interp: Interpreter, config: Config):
447466 if self .config .hist_file .exists ():
448467 try :
449468 self .rl_history .load (
450- str (self .config .hist_file ), getpreferredencoding () or "ascii"
469+ str (self .config .hist_file ),
470+ getpreferredencoding () or "ascii" ,
451471 )
452472 except OSError :
453473 pass
@@ -749,7 +769,9 @@ def complete(self, tab: bool = False) -> Optional[bool]:
749769 else :
750770 return False
751771
752- def format_docstring (self , docstring : str , width : int , height : int ) -> List [str ]:
772+ def format_docstring (
773+ self , docstring : str , width : int , height : int
774+ ) -> List [str ]:
753775 """Take a string and try to format it into a sane list of strings to be
754776 put into the suggestion box."""
755777
0 commit comments