Skip to content

Commit 2de72b3

Browse files
Ben-Regsebastinas
authored andcommitted
Ran black and codespell
1 parent c2f1c39 commit 2de72b3

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

bpython/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
Union,
6868
Tuple,
6969
Collection,
70-
Dict
70+
Dict,
7171
)
7272
import unicodedata
7373
from dataclasses import dataclass
@@ -2058,7 +2058,7 @@ def main_curses(
20582058

20592059
exit_value = clirepl.repl()
20602060
if hasattr(sys, "exitfunc"):
2061-
# Seems like the if statment should satisfy mypy, but it doesn't
2061+
# Seems like the if statement should satisfy mypy, but it doesn't
20622062
sys.exitfunc() # type:ignore[attr-defined]
20632063
delattr(sys, "exitfunc")
20642064

bpython/repl.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,18 @@
3737
from itertools import takewhile
3838
from pathlib import Path
3939
from 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+
)
4152
from ._typing_compat import Literal
4253

4354
from 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

Comments
 (0)