]> granicus.if.org Git - python/commitdiff
Deprecate the sets module.
authorBrett Cannon <bcannon@gmail.com>
Sat, 13 Jan 2007 00:29:49 +0000 (00:29 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 13 Jan 2007 00:29:49 +0000 (00:29 +0000)
Doc/lib/libsets.tex
Lib/sets.py
Lib/test/test___all__.py
Lib/test/test_sets.py
Misc/NEWS

index 22bf34bfb4f728bf7397adbbe95f3dbfc0a2acfe..efa4e0f3b923af0d47d2a0698ab8bb830994d2ed 100644 (file)
@@ -9,6 +9,8 @@
 \sectionauthor{Raymond D. Hettinger}{python@rcn.com}
 
 \versionadded{2.3}
+\deprecated{2.6}{ The built-in \code{set}/\code{frozneset} types replace this
+module.}
 
 The \module{sets} module provides classes for constructing and manipulating
 unordered collections of unique elements.  Common uses include membership
index 32a0dd64ff871dc15ef658b699096931c7afa405..99ee931d9bb7a34d2876a6549228a10c16ecd75f 100644 (file)
@@ -80,6 +80,10 @@ except ImportError:
 
 __all__ = ['BaseSet', 'Set', 'ImmutableSet']
 
+import warnings
+warnings.warn("the sets module is deprecated", DeprecationWarning,
+                stacklevel=2)
+
 class BaseSet(object):
     """Common base class for mutable and immutable sets."""
 
index c45e13997ab9a795257aa432f47beb94da8592f9..dbc6bc31dad7dfce5c3ae3e531af96a2db078791 100644 (file)
@@ -9,6 +9,8 @@ warnings.filterwarnings("ignore",
                         "the gopherlib module is deprecated",
                         DeprecationWarning,
                         "<string>")
+warnings.filterwarnings("ignore", "the sets module is deprecated",
+                        DeprecationWarning, "<string>")
 
 class AllTest(unittest.TestCase):
 
index 85e4a22e840a4b8577c06baebf698b0a856b99ee..efa388f3df31104299f731dc759395d9c4611902 100644 (file)
@@ -1,5 +1,9 @@
 #!/usr/bin/env python
 
+import warnings
+warnings.filterwarnings("ignore", "the sets module is deprecated",
+                        DeprecationWarning, "test\.test_sets")
+
 import unittest, operator, copy, pickle, random
 from sets import Set, ImmutableSet
 from test import test_support
index 0319fc1adb91b9869196b0fc90e43529c686538c..754ceae53f0d1f9a41da4ab90e4047de3524c477 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -109,6 +109,9 @@ Core and builtins
 Library
 -------
 
+- The sets module has been deprecated.  Use the built-in set/frozenset types
+  instead.
+
 - Bug #1610795: make ctypes.util.find_library work on BSD systems.
 
 - Fixes for 64-bit Windows: In ctypes.wintypes, correct the