Skip to content

Commit 76028e3

Browse files
committed
chore(compat): mypy updates for LegacyVersion
1 parent e79f127 commit 76028e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libtmux/_compat.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,27 @@ def _legacy_cmpkey(version: str) -> LegacyCmpKey:
100100

101101
@functools.total_ordering
102102
class LegacyVersion:
103-
_key = None # type: Union[CmpKey, LegacyCmpKey]
103+
_key: LegacyCmpKey
104104

105105
def __hash__(self) -> int:
106106
return hash(self._key)
107107

108-
def __init__(self, version: str) -> None:
108+
def __init__(self, version: object) -> None:
109109
self._version = str(version)
110110
self._key = _legacy_cmpkey(self._version)
111111

112112
def __str__(self) -> str:
113113
return self._version
114114

115-
def __lt__(self, other):
115+
def __lt__(self, other: object) -> bool:
116116
if isinstance(other, str):
117117
other = LegacyVersion(other)
118118
if not isinstance(other, LegacyVersion):
119119
return NotImplemented
120120

121121
return self._key < other._key
122122

123-
def __eq__(self, other) -> bool:
123+
def __eq__(self, other: object) -> bool:
124124
if isinstance(other, str):
125125
other = LegacyVersion(other)
126126
if not isinstance(other, LegacyVersion):
@@ -133,4 +133,4 @@ def __repr__(self) -> str:
133133

134134
LooseVersion = LegacyVersion
135135
except ImportError:
136-
from distutils.version import LooseVersion, Version
136+
from distutils.version import LooseVersion, Version # type: ignore

0 commit comments

Comments
 (0)