From d5ba27df2e9789d8893b64255feada1c3001ce9f Mon Sep 17 00:00:00 2001 From: Kyle Baird Date: Mon, 14 Aug 2017 08:45:48 -0400 Subject: Make class name dynamic in Version.__repr__ Do this so any subclasses will be shown with their class name instead of a potentially misleading Version --- semantic_version/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/semantic_version/base.py b/semantic_version/base.py index ed7b87a..4ddaf05 100644 --- a/semantic_version/base.py +++ b/semantic_version/base.py @@ -271,7 +271,8 @@ class Version(object): return version def __repr__(self): - return 'Version(%r%s)' % ( + return '%s(%r%s)' % ( + self.__class__.__name__, str(self), ', partial=True' if self.partial else '', ) -- cgit v1.2.1