summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-10-12 11:16:47 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-10-12 11:16:47 +0200
commitb70054a74da84c69f7c72f26c5be6753ac29c74d (patch)
tree1f7954f1fd9c23d1d6707163d52ec40b4877a558
parent0425a654e919c07f25f818eddd09c5990a339b99 (diff)
downloadqutebrowser-b70054a74da84c69f7c72f26c5be6753ac29c74d.tar.gz
qutebrowser-b70054a74da84c69f7c72f26c5be6753ac29c74d.zip
mypy: Make sure NeighborList items are comparable
-rw-r--r--qutebrowser/utils/usertypes.py9
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: