[Python-checkins] r88156 - in python/branches/py3k: Lib/hashlib.py Lib/test/test_hashlib.py Misc/NEWS

raymond.hettinger python-checkins at python.org
Mon Jan 24 05:52:28 CET 2011


Author: raymond.hettinger
Date: Mon Jan 24 05:52:27 2011
New Revision: 88156
Log:
Make the type consistent for hashlib algorithm constants. (Reviewed by Benjamin).
Modified:
 python/branches/py3k/Lib/hashlib.py
 python/branches/py3k/Lib/test/test_hashlib.py
 python/branches/py3k/Misc/NEWS
Modified: python/branches/py3k/Lib/hashlib.py
==============================================================================
--- python/branches/py3k/Lib/hashlib.py	(original)
+++ python/branches/py3k/Lib/hashlib.py	Mon Jan 24 05:52:27 2011
@@ -56,8 +56,8 @@
 # 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')
Modified: python/branches/py3k/Lib/test/test_hashlib.py
==============================================================================
--- python/branches/py3k/Lib/test/test_hashlib.py	(original)
+++ python/branches/py3k/Lib/test/test_hashlib.py	Mon Jan 24 05:52:27 2011
@@ -103,7 +103,7 @@
 
 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):
Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Mon Jan 24 05:52:27 2011
@@ -16,6 +16,9 @@
 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.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /