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
242b80f0
Commit
242b80f0
authored
Aug 20, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gave _ellipsis_match() an attractive new leading underscore.
parent
23053518
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/doctest.py
Lib/doctest.py
+4
-4
No files found.
Lib/doctest.py
View file @
242b80f0
...
@@ -390,10 +390,10 @@ class _SpoofOut(StringIO):
...
@@ -390,10 +390,10 @@ class _SpoofOut(StringIO):
del
self
.
softspace
del
self
.
softspace
# Worst-case linear-time ellipsis matching.
# Worst-case linear-time ellipsis matching.
def
ellipsis_match
(
want
,
got
):
def
_
ellipsis_match
(
want
,
got
):
"""
"""
Essentially the only subtle case:
Essentially the only subtle case:
>>> ellipsis_match('aa...aa', 'aaa')
>>>
_
ellipsis_match('aa...aa', 'aaa')
False
False
"""
"""
if
ELLIPSIS_MARKER
not
in
want
:
if
ELLIPSIS_MARKER
not
in
want
:
...
@@ -426,7 +426,7 @@ def ellipsis_match(want, got):
...
@@ -426,7 +426,7 @@ def ellipsis_match(want, got):
if
startpos
>
endpos
:
if
startpos
>
endpos
:
# Exact end matches required more characters than we have, as in
# Exact end matches required more characters than we have, as in
# ellipsis_match('aa...aa', 'aaa')
#
_
ellipsis_match('aa...aa', 'aaa')
return
False
return
False
# For the rest, we only need to find the leftmost non-overlapping
# For the rest, we only need to find the leftmost non-overlapping
...
@@ -1558,7 +1558,7 @@ class OutputChecker:
...
@@ -1558,7 +1558,7 @@ class OutputChecker:
# The ELLIPSIS flag says to let the sequence "..." in `want`
# The ELLIPSIS flag says to let the sequence "..." in `want`
# match any substring in `got`.
# match any substring in `got`.
if optionflags & ELLIPSIS:
if optionflags & ELLIPSIS:
if ellipsis_match(want, got):
if
_
ellipsis_match(want, got):
return True
return True
# We didn'
t
find
any
match
;
return
false
.
# We didn'
t
find
any
match
;
return
false
.
...
...
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