Skip to content

Commit e1ab500

Browse files
bjoernricksy0urself
authored andcommitted
Add: Implement repr for Version classes
This is required for debugging version classes especially failing tests.
1 parent 2c6ca13 commit e1ab500

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pontos/version/version.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ def __ne__(self, other: Any) -> bool:
119119
def __str__(self) -> str:
120120
"""A string representation of the version"""
121121

122+
def __repr__(self) -> str:
123+
"""A representation of the Version"""
124+
return f"<{self.__class__.__name__}('{self}')>"
125+
122126

123127
ParseVersionFuncType = Callable[[str], Version]
124128

0 commit comments

Comments
 (0)