[Python-checkins] r53406 - in python/trunk: Doc/lib/libsets.tex Lib/sets.py Lib/test/test___all__.py Lib/test/test_sets.py Misc/NEWS
brett.cannon
python-checkins at python.org
Sat Jan 13 01:29:50 CET 2007
Author: brett.cannon
Date: Sat Jan 13 01:29:49 2007
New Revision: 53406
Modified:
python/trunk/Doc/lib/libsets.tex
python/trunk/Lib/sets.py
python/trunk/Lib/test/test___all__.py
python/trunk/Lib/test/test_sets.py
python/trunk/Misc/NEWS
Log:
Deprecate the sets module.
Modified: python/trunk/Doc/lib/libsets.tex
==============================================================================
--- python/trunk/Doc/lib/libsets.tex (original)
+++ python/trunk/Doc/lib/libsets.tex Sat Jan 13 01:29:49 2007
@@ -9,6 +9,8 @@
\sectionauthor{Raymond D. Hettinger}{python at 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
Modified: python/trunk/Lib/sets.py
==============================================================================
--- python/trunk/Lib/sets.py (original)
+++ python/trunk/Lib/sets.py Sat Jan 13 01:29:49 2007
@@ -80,6 +80,10 @@
__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."""
Modified: python/trunk/Lib/test/test___all__.py
==============================================================================
--- python/trunk/Lib/test/test___all__.py (original)
+++ python/trunk/Lib/test/test___all__.py Sat Jan 13 01:29:49 2007
@@ -9,6 +9,8 @@
"the gopherlib module is deprecated",
DeprecationWarning,
"<string>")
+warnings.filterwarnings("ignore", "the sets module is deprecated",
+ DeprecationWarning, "<string>")
class AllTest(unittest.TestCase):
Modified: python/trunk/Lib/test/test_sets.py
==============================================================================
--- python/trunk/Lib/test/test_sets.py (original)
+++ python/trunk/Lib/test/test_sets.py Sat Jan 13 01:29:49 2007
@@ -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
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Sat Jan 13 01:29:49 2007
@@ -109,6 +109,9 @@
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
More information about the Python-checkins
mailing list