Refs #2578 -- implement __hash__ on InhibitAnyPolicy
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index fe9bcf9..db55789 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -693,6 +693,9 @@
     def __ne__(self, other):
         return not self == other
 
+    def __hash__(self):
+        return hash(self.skip_certs)
+
     skip_certs = utils.read_only_property("_skip_certs")
 
 
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index b13405d..d8a5f9d 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -3398,6 +3398,13 @@
         assert iap != iap2
         assert iap != object()
 
+    def test_hash(self):
+        iap = x509.InhibitAnyPolicy(1)
+        iap2 = x509.InhibitAnyPolicy(1)
+        iap3 = x509.InhibitAnyPolicy(4)
+        assert hash(iap) == hash(iap2)
+        assert hash(iap) != hash(iap3)
+
 
 @pytest.mark.requires_backend_interface(interface=RSABackend)
 @pytest.mark.requires_backend_interface(interface=X509Backend)