Skip to content

Commit 132cd49

Browse files
committed
Use frozensets for containment checks
1 parent 519ec7b commit 132cd49

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Lib/_pyrepl/commands.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,14 +521,14 @@ def do(self) -> None:
521521
not self.reader.buffer
522522
and getattr(self.reader, "more_lines", None) is not None
523523
and data[:3] == ">>>"
524-
and data[3:4] in ("", " ", "\r", "\n")
524+
and data[3:4] in {"", " ", "\r", "\n"}
525525
):
526526
# A pasted interactive session contains prompts and output.
527527
lines = []
528528
for line in re.findall(r"[^\r\n]*(?:\r\n?|\n|$)", data):
529529
if line.startswith((">>> ", "... ")):
530530
lines.append(line[4:])
531-
elif line.rstrip("\r\n") in (">>>", "..."):
531+
elif line.rstrip("\r\n") in {">>>", "..."}:
532532
lines.append(line[3:])
533533
data = "".join(lines)
534534
self.reader.insert(data)

0 commit comments

Comments
 (0)