Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/packaging/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ class InvalidVersion(ValueError):
class _BaseVersion:
__slots__ = ()

@property
def _key(self) -> tuple[Any, ...]:
raise NotImplementedError # pragma: no cover
# This can also be a normal member (see the packaging_legacy package);
# we are just requiring it to be readable. Actually defining a property
# has runtime effect on subclasses, so it's typing only.
if typing.TYPE_CHECKING:

@property
def _key(self) -> tuple[Any, ...]: ...

def __hash__(self) -> int:
return hash(self._key)
Expand Down
Loading