]> granicus.if.org Git - python/commitdiff
Make the type consistent for hashlib algorithm constants. (Reviewed by Benjamin).
authorRaymond Hettinger <python@rcn.com>
Mon, 24 Jan 2011 04:52:27 +0000 (04:52 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 24 Jan 2011 04:52:27 +0000 (04:52 +0000)
Lib/hashlib.py
Lib/test/test_hashlib.py
Misc/NEWS

index 9d860c481b1ca6e928d35825385f861c7f22d8a8..0d7e3250d5b48b9bf50f7b26c386bda0b09547d5 100644 (file)
@@ -56,8 +56,8 @@ More condensed:
 # always available algorithm is added.
 __always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
 
-algorithms_guaranteed = __always_supported
-algorithms_available = frozenset(__always_supported)
+algorithms_guaranteed = set(__always_supported)
+algorithms_available = set(__always_supported)
 
 __all__ = __always_supported + ('new', 'algorithms_guaranteed',
                                 'algorithms_available')
index 1f5a8be509f012b4519192e0c0cafef2839a1e16..fe316fdd39a2644aeb4e301e29d123b455c8c7de 100644 (file)
@@ -103,7 +103,7 @@ class HashLibTestCase(unittest.TestCase):
 
     def test_algorithms_guaranteed(self):
         self.assertEqual(hashlib.algorithms_guaranteed,
-            tuple(_algo for _algo in self.supported_hash_names
+            set(_algo for _algo in self.supported_hash_names
                   if _algo.islower()))
 
     def test_algorithms_available(self):
index 54a647aadb287362bd9f52a2194b7d1200e575a2..036e562da52d98b0c40df841f004cdcf13371667 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,9 @@ Core and Builtins
 Library
 -------
 
+- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
+  return sets instead of one returning a tuple and the other a frozenset.
+
 - Issue #10987: Fix the recursion limit handling in the _pickle module.
 
 - Issue #10983: Fix several bugs making tunnel requests in http.client.