Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9465700

Browse filesBrowse files
committed
Simplify is_closing_quote
1 parent 60baf5e commit 9465700
Copy full SHA for 9465700

1 file changed

+3-5Lines changed: 3 additions & 5 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/curtsiesfrontend/repl.py‎

Copy file name to clipboardExpand all lines: bpython/curtsiesfrontend/repl.py
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -814,16 +814,14 @@ def process_key_event(self, e: str) -> None:
814814
else:
815815
self.add_normal_character(e)
816816

817-
def is_closing_quote(self, e):
817+
def is_closing_quote(self, e: str) -> bool:
818818
char_count = self._current_line.count(e)
819-
if (
819+
return (
820820
char_count % 2 == 0
821821
and cursor_on_closing_char_pair(
822822
self._cursor_offset, self._current_line, e
823823
)[0]
824-
):
825-
return True
826-
return False
824+
)
827825

828826
def insert_char_pair_start(self, e):
829827
"""Accepts character which is a part of CHARACTER_PAIR_MAP

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.