diff options
author | John Vandenberg <jayvdb@gmail.com> | 2020-02-04 21:54:17 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 08:54:17 -0600 |
commit | 95958b4712756bb531549a41010c9751f2233ba4 (patch) | |
tree | 06179813dba38353f24ab5105de1750cd8f955df | |
parent | 672eaabf3c84f6b6b8fec5f2b4d4f3d30ae84416 (diff) | |
download | urllib3-95958b4712756bb531549a41010c9751f2233ba4.tar.gz |
Add __repr__ to Timeout (#1795)
-rw-r--r-- | src/urllib3/util/timeout.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/urllib3/util/timeout.py b/src/urllib3/util/timeout.py index 98837005..b61fea75 100644 --- a/src/urllib3/util/timeout.py +++ b/src/urllib3/util/timeout.py @@ -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. |