]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Drop unneccessary __hash__ methods
authorTom Christie <tom@tomchristie.com>
Thu, 25 Apr 2019 16:05:40 +0000 (17:05 +0100)
committerTom Christie <tom@tomchristie.com>
Thu, 25 Apr 2019 16:05:40 +0000 (17:05 +0100)
httpcore/config.py
tests/test_config.py

index b0fadc4017561cf31660ccf5714d1373f58e78d3..7166c05f75cf2e6fe922e422cc37a88a22e6365d 100644 (file)
@@ -27,10 +27,6 @@ class SSLConfig:
             and self.verify == other.verify
         )
 
-    def __hash__(self) -> int:
-        as_tuple = (self.cert, self.verify)
-        return hash(as_tuple)
-
     def __repr__(self) -> str:
         class_name = self.__class__.__name__
         return f"{class_name}(cert={self.cert}, verify={self.verify})"
@@ -144,15 +140,6 @@ class TimeoutConfig:
             and self.pool_timeout == other.pool_timeout
         )
 
-    def __hash__(self) -> int:
-        as_tuple = (
-            self.connect_timeout,
-            self.read_timeout,
-            self.write_timeout,
-            self.pool_timeout,
-        )
-        return hash(as_tuple)
-
     def __repr__(self) -> str:
         class_name = self.__class__.__name__
         if self.timeout is not None:
@@ -181,10 +168,6 @@ class PoolLimits:
             and self.hard_limit == other.hard_limit
         )
 
-    def __hash__(self) -> int:
-        as_tuple = (self.soft_limit, self.hard_limit)
-        return hash(as_tuple)
-
     def __repr__(self) -> str:
         class_name = self.__class__.__name__
         return (
index 8112d7c24741dca101535d7e8c9dd5771e18731b..74c1267ea179586cc0fe4dfa4f1f1bbb1e815677 100644 (file)
@@ -35,24 +35,3 @@ def test_timeout_eq():
 def test_limits_eq():
     limits = httpcore.PoolLimits(hard_limit=100)
     assert limits == httpcore.PoolLimits(hard_limit=100)
-
-
-def test_ssl_hash():
-    cache = {}
-    ssl = httpcore.SSLConfig(verify=False)
-    cache[ssl] = "example"
-    assert cache[httpcore.SSLConfig(verify=False)] == "example"
-
-
-def test_timeout_hash():
-    cache = {}
-    timeout = httpcore.TimeoutConfig(timeout=5.0)
-    cache[timeout] = "example"
-    assert cache[httpcore.TimeoutConfig(timeout=5.0)] == "example"
-
-
-def test_limits_hash():
-    cache = {}
-    limits = httpcore.PoolLimits(hard_limit=100)
-    cache[limits] = "example"
-    assert cache[httpcore.PoolLimits(hard_limit=100)] == "example"