summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-08-08 01:52:57 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-08-08 01:52:57 (GMT)
commitbafb1fed516a252eaeb1aa52a5287d838fe4603f (patch)
tree1ea0913db803f3fe5270f83def81988177af7d8d /Lib/doctest.py
parentf727c6c2c7e608368fd1514ab46b1ed87ba57baf (diff)
downloadcpython-bafb1fed516a252eaeb1aa52a5287d838fe4603f.zip
cpython-bafb1fed516a252eaeb1aa52a5287d838fe4603f.tar.gz
cpython-bafb1fed516a252eaeb1aa52a5287d838fe4603f.tar.bz2
Deprecate the doctest.is_private() function.
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index 6e28340..bf39e38 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -377,6 +377,9 @@ def is_private(prefix, base):
Return true iff base begins with an (at least one) underscore, but
does not both begin and end with (at least) two underscores.
+ >>> import warnings
+ >>> warnings.filterwarnings("ignore", "is_private", DeprecationWarning,
+ ... "doctest", 0)
>>> is_private("a.b", "my_func")
False
>>> is_private("____", "_my_func")
@@ -392,6 +395,9 @@ def is_private(prefix, base):
>>> is_private("", "") # senseless but consistent
False
"""
+ warnings.warn("is_private is deprecated; it wasn't useful; "
+ "examine DocTestFinder.find() lists instead",
+ DeprecationWarning)
return base[:1] == "_" and not base[:2] == "__" == base[-2:]
def _extract_future_flags(globs):