Skip to content

Commit c5f3d69

Browse files
authored
Merge pull request #13216 from notatallshaw/add-repr-to-RequiresPythonCandidate
Add repr to RequiresPythonCandidate
2 parents 3994c61 + 30f46b6 commit c5f3d69

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

news/13216.trivial.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add repr to RequiresPythonCandidate.

src/pip/_internal/resolution/resolvelib/candidates.py

+3
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ def __init__(self, py_version_info: Optional[Tuple[int, ...]]) -> None:
552552
def __str__(self) -> str:
553553
return f"Python {self._version}"
554554

555+
def __repr__(self) -> str:
556+
return f"{self.__class__.__name__}({self._version!r})"
557+
555558
@property
556559
def project_name(self) -> NormalizedName:
557560
return REQUIRES_PYTHON_IDENTIFIER

0 commit comments

Comments
 (0)