]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Deprecate the doctest.is_private() function.
authorTim Peters <tim.peters@gmail.com>
Sun, 8 Aug 2004 01:52:57 +0000 (01:52 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 8 Aug 2004 01:52:57 +0000 (01:52 +0000)
Lib/doctest.py

index 6e2834057a2ee5946003ebb6ba5a30c4bff17dc9..bf39e3800325255dd3ba1b0986053c8c2073fc64 100644 (file)
@@ -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):