@@ -100,27 +100,27 @@ def _legacy_cmpkey(version: str) -> LegacyCmpKey:
100
100
101
101
@functools .total_ordering
102
102
class LegacyVersion :
103
- _key = None # type: Union[CmpKey, LegacyCmpKey]
103
+ _key : LegacyCmpKey
104
104
105
105
def __hash__ (self ) -> int :
106
106
return hash (self ._key )
107
107
108
- def __init__ (self , version : str ) -> None :
108
+ def __init__ (self , version : object ) -> None :
109
109
self ._version = str (version )
110
110
self ._key = _legacy_cmpkey (self ._version )
111
111
112
112
def __str__ (self ) -> str :
113
113
return self ._version
114
114
115
- def __lt__ (self , other ) :
115
+ def __lt__ (self , other : object ) -> bool :
116
116
if isinstance (other , str ):
117
117
other = LegacyVersion (other )
118
118
if not isinstance (other , LegacyVersion ):
119
119
return NotImplemented
120
120
121
121
return self ._key < other ._key
122
122
123
- def __eq__ (self , other ) -> bool :
123
+ def __eq__ (self , other : object ) -> bool :
124
124
if isinstance (other , str ):
125
125
other = LegacyVersion (other )
126
126
if not isinstance (other , LegacyVersion ):
@@ -133,4 +133,4 @@ def __repr__(self) -> str:
133
133
134
134
LooseVersion = LegacyVersion
135
135
except ImportError :
136
- from distutils .version import LooseVersion , Version
136
+ from distutils .version import LooseVersion , Version # type: ignore
0 commit comments