diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-11-04 10:54:04 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-11-04 10:59:41 +1300 |
commit | 4eb2b56dec09bf3e7322e402ad5ba46523309138 (patch) | |
tree | dc506686e58750b9a6e394fbc78473d9e9792d22 /mitmproxy/connections.py | |
parent | 6c8c4465d9971076e9a04f8042aebd5d71f67d59 (diff) | |
download | mitmproxy-4eb2b56dec09bf3e7322e402ad5ba46523309138.tar.gz mitmproxy-4eb2b56dec09bf3e7322e402ad5ba46523309138.tar.bz2 mitmproxy-4eb2b56dec09bf3e7322e402ad5ba46523309138.zip |
Let's not over-ride __bool__ on connection objects
If I had a thousand years and every thesaurus in the world, I still couldn't
adequately express how much I dislike this piece of interface design.
Diffstat (limited to 'mitmproxy/connections.py')
-rw-r--r-- | mitmproxy/connections.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/connections.py b/mitmproxy/connections.py index 143f576b..f3a75222 100644 --- a/mitmproxy/connections.py +++ b/mitmproxy/connections.py @@ -47,7 +47,7 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): self.cipher_name = None self.tls_version = None - def __bool__(self): + def connected(self): return bool(self.connection) and not self.finished def __repr__(self): @@ -146,7 +146,7 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject): self.timestamp_ssl_setup = None self.protocol = None - def __bool__(self): + def connected(self): return bool(self.connection) and not self.finished def __repr__(self): |