Deprecate the sets module.
This commit is contained in:
parent
6fd4549bc6
commit
093b67061a
|
@ -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
|
||||
|
|
|
@ -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."""
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue