diff options
author | Kyle Baird <kyle.baird@milliman.com> | 2017-08-14 08:45:48 -0400 |
---|---|---|
committer | Raphaƫl Barrois <raphael.barrois@polytechnique.org> | 2018-06-18 15:43:37 +0200 |
commit | d5ba27df2e9789d8893b64255feada1c3001ce9f (patch) | |
tree | 075b9d804de12a024b55dcca3ca570ea785361b2 /semantic_version | |
parent | f7f8c7b3a25f004838719d317bc8e83fc3720802 (diff) | |
download | semantic-version-d5ba27df2e9789d8893b64255feada1c3001ce9f.tar.gz |
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
Diffstat (limited to 'semantic_version')
-rw-r--r-- | semantic_version/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 '', ) |