Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
349a6efa
Commit
349a6efa
authored
Aug 08, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate the doctest.is_private() function.
parent
257ed8c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
Lib/doctest.py
Lib/doctest.py
+6
-0
No files found.
Lib/doctest.py
View file @
349a6efa
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment