Skip to content

Commit 28c1a05

Browse files
authored
Relax typing of _key on _BaseVersion (#669)
1 parent a6c9bc4 commit 28c1a05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/packaging/version.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import collections
1111
import itertools
1212
import re
13-
from typing import Callable, Optional, SupportsInt, Tuple, Union
13+
from typing import Any, Callable, Optional, SupportsInt, Tuple, Union
1414

1515
from ._structures import Infinity, InfinityType, NegativeInfinity, NegativeInfinityType
1616

@@ -63,7 +63,7 @@ class InvalidVersion(ValueError):
6363

6464

6565
class _BaseVersion:
66-
_key: CmpKey
66+
_key: Tuple[Any, ...]
6767

6868
def __hash__(self) -> int:
6969
return hash(self._key)
@@ -179,6 +179,7 @@ class Version(_BaseVersion):
179179
"""
180180

181181
_regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE)
182+
_key: CmpKey
182183

183184
def __init__(self, version: str) -> None:
184185
"""Initialize a Version object.

0 commit comments

Comments
 (0)