Skip to content

Commit a0f7fae

Browse files
minor formatting changes to pass black linter test
1 parent d57f008 commit a0f7fae

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

bpython/line.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def current_word(cursor_offset: int, line: str) -> Optional[LinePart]:
3939
_match_all_dict_keys = r"""[^\]]*"""
4040

4141
# https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
42-
_match_single_quote_str_bytes = \
43-
r""" # bytes repr() begins with `b` character; bytes and str begin with `'`
42+
_match_single_quote_str_bytes = r"""
43+
# bytes repr() begins with `b` character; bytes and str begin with `'`
4444
b?'
4545
# after an even number of `\`, next `\` and subsequent char are interpreted
4646
# as an escape sequence; this handles `\'` in the string repr()
@@ -57,8 +57,8 @@ def current_word(cursor_offset: int, line: str) -> Optional[LinePart]:
5757

5858
# bytes and str repr() only uses double quotes if the string contains 1 or more
5959
# `'` character and exactly 0 `"` characters
60-
_match_double_quote_str_bytes = \
61-
r""" # bytes repr() begins with `b` character
60+
_match_double_quote_str_bytes = r"""
61+
# bytes repr() begins with `b` character
6262
b?"
6363
# string continues until a `"` character is reached
6464
[^"]*
@@ -69,11 +69,11 @@ def current_word(cursor_offset: int, line: str) -> Optional[LinePart]:
6969
_match_dict_before_key = r"""[\w_][\w0-9._]*\["""
7070

7171
_current_dict_key_re = LazyReCompile(
72-
f'{_match_dict_before_key}((?:'
73-
f'{_match_single_quote_str_bytes}|'
74-
f'{_match_double_quote_str_bytes}|'
75-
f'{_match_all_dict_keys}|)*)',
76-
re.VERBOSE
72+
f"{_match_dict_before_key}((?:"
73+
f"{_match_single_quote_str_bytes}|"
74+
f"{_match_double_quote_str_bytes}|"
75+
f"{_match_all_dict_keys}|)*)",
76+
re.VERBOSE,
7777
)
7878

7979

@@ -89,11 +89,11 @@ def current_dict_key(cursor_offset: int, line: str) -> Optional[LinePart]:
8989
_capture_dict_name = r"""([\w_][\w0-9._]*)\["""
9090

9191
_current_dict_re = LazyReCompile(
92-
f'{_capture_dict_name}((?:'
93-
f'{_match_single_quote_str_bytes}|'
94-
f'{_match_double_quote_str_bytes}|'
95-
f'{_match_all_dict_keys}|)*)',
96-
re.VERBOSE
92+
f"{_capture_dict_name}((?:"
93+
f"{_match_single_quote_str_bytes}|"
94+
f"{_match_double_quote_str_bytes}|"
95+
f"{_match_all_dict_keys}|)*)",
96+
re.VERBOSE,
9797
)
9898

9999

bpython/test/test_line_properties.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def test_simple(self):
183183
self.assertAccess("asdf[<(1, 2)>|]")
184184
# TODO self.assertAccess('d[d[<12|>')
185185
self.assertAccess("d[<'a>|")
186-
self.assertAccess("object.dict['a\'bcd'], object.dict[<'abc>|")
186+
self.assertAccess("object.dict['a'bcd'], object.dict[<'abc>|")
187187
self.assertAccess(r"object.dict[<'a\'\\\"\n\\'>|")
188188
self.assertAccess("object.dict[<\"abc'>|")
189189
self.assertAccess("object.dict[<(1, 'apple', 2.134>|]")

0 commit comments

Comments
 (0)