Skip to content

Commit

Permalink
Relax typing of _key on _BaseVersion (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
di committed Feb 6, 2023
1 parent a6c9bc4 commit 28c1a05
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/packaging/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import collections
import itertools
import re
from typing import Callable, Optional, SupportsInt, Tuple, Union
from typing import Any, Callable, Optional, SupportsInt, Tuple, Union

from ._structures import Infinity, InfinityType, NegativeInfinity, NegativeInfinityType

Expand Down Expand Up @@ -63,7 +63,7 @@ class InvalidVersion(ValueError):


class _BaseVersion:
_key: CmpKey
_key: Tuple[Any, ...]

def __hash__(self) -> int:
return hash(self._key)
Expand Down Expand Up @@ -179,6 +179,7 @@ class Version(_BaseVersion):
"""

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

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

0 comments on commit 28c1a05

Please sign in to comment.