FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Prepend element instead of appending and reversing · bpython/bpython@37d5fdd · GitHub

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)

Back | FazBrowse Home | New Git URL