diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-01-13 12:34:47 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-01-13 20:27:21 +0100 |
commit | 1707607f294222a25ee066008b9cc42ae9756378 (patch) | |
tree | b49c1672b4ba440eb832bd6a2262ad709deea0a6 /qutebrowser/mainwindow/tabbedbrowser.py | |
parent | 0afe7989f8febfecc8b7a48d8c834350c4a62569 (diff) | |
download | qutebrowser-1707607f294222a25ee066008b9cc42ae9756378.tar.gz qutebrowser-1707607f294222a25ee066008b9cc42ae9756378.zip |
dataclasses: Fix typing around undo
See #6023
Diffstat (limited to 'qutebrowser/mainwindow/tabbedbrowser.py')
-rw-r--r-- | qutebrowser/mainwindow/tabbedbrowser.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 68e4de5ff..cc52bffcf 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -45,13 +45,16 @@ class _UndoEntry: """Information needed for :undo.""" url: QUrl - history: bytes # FIXME + history: bytes index: int pinned: bool created_at: datetime.datetime = dataclasses.field( default_factory=datetime.datetime.now) +UndoStackType = MutableSequence[MutableSequence[_UndoEntry]] + + class TabDeque: """Class which manages the 'last visited' tab stack. @@ -222,8 +225,7 @@ class TabbedBrowser(QWidget): # This init is never used, it is immediately thrown away in the next # line. - self.undo_stack: MutableSequence[MutableSequence[_UndoEntry]] = ( - collections.deque()) + self.undo_stack: UndoStackType = collections.deque() self._update_stack_size() self._filter = signalfilter.SignalFilter(win_id, self) self._now_focused = None |