diff options
Diffstat (limited to 'lib/_range.py')
-rw-r--r-- | lib/_range.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/_range.py b/lib/_range.py index fd15a76..e72c878 100644 --- a/lib/_range.py +++ b/lib/_range.py @@ -62,6 +62,19 @@ class Range(object): return "%s(%r, %r, %r)" % (self.__class__.__name__, self._lower, self._upper, self._bounds) + def __str__(self): + if self._bounds is None: + return 'empty' + + items = [ + self._bounds[0], + str(self._lower), + ', ', + str(self._upper), + self._bounds[1] + ] + return ''.join(items) + @property def lower(self): """The lower bound of the range. `!None` if empty or unbound.""" |