← 返回首页
Prepend element instead of appending and reversing · bpython/bpython@37d5fdd · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit 37d5fdd

Browse files
committed
Prepend element instead of appending and reversing
1 parent 6e402e2 commit 37d5fdd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎bpython/history.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import os
2525
import stat
26-
from itertools import islice
26+
from itertools import islice, chain
2727
from typing import Iterable, Optional, List, TextIO
2828

2929
from .translations import _
@@ -100,7 +100,7 @@ def entry(self) -> str:
100100

101101
@property
102102
def entries_by_index(self) -> List[str]:
103-
return list(reversed(self.entries + [self.saved_line]))
103+
return list(chain((self.saved_line, ), reversed(self.entries)))
104104

105105
def find_match_backward(
106106
self, search_term: str, include_current: bool = False

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.