diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-10-12 11:16:47 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-10-12 11:16:47 +0200 |
commit | b70054a74da84c69f7c72f26c5be6753ac29c74d (patch) | |
tree | 1f7954f1fd9c23d1d6707163d52ec40b4877a558 | |
parent | 0425a654e919c07f25f818eddd09c5990a339b99 (diff) | |
download | qutebrowser-b70054a74da84c69f7c72f26c5be6753ac29c74d.tar.gz qutebrowser-b70054a74da84c69f7c72f26c5be6753ac29c74d.zip |
mypy: Make sure NeighborList items are comparable
-rw-r--r-- | qutebrowser/utils/usertypes.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/qutebrowser/utils/usertypes.py b/qutebrowser/utils/usertypes.py index 0b6f9c219..6d5c2f23e 100644 --- a/qutebrowser/utils/usertypes.py +++ b/qutebrowser/utils/usertypes.py @@ -30,7 +30,14 @@ from PyQt5.QtCore import QUrl from qutebrowser.utils import log, qtutils, utils -_T = typing.TypeVar('_T') +if typing.TYPE_CHECKING: + # Protocol was added in Python 3.8 + from typing import Protocol, Any + class SupportsLessThan(Protocol): + def __lt__(self, other: Any) -> bool: ... + + +_T = typing.TypeVar('_T', bound='SupportsLessThan') class Unset: |