Add __repr__ to Timeout
@@ -98,7 +98,7 @@ class Timeout(object):
self.total = self._validate_timeout(total, "total")
self._start_connect = None
- def __str__(self):
+ def __repr__(self):
return "%s(connect=%r, read=%r, total=%r)" % (
type(self).__name__,
self._connect,
@@ -106,6 +106,9 @@ class Timeout(object):
self.total,
)
+ # __str__ provided for backwards compatibility
+ __str__ = __repr__
+
@classmethod
def _validate_timeout(cls, value, name):
""" Check that a timeout attribute is valid.
