[Python-checkins] python/dist/src/Lib doctest.py,1.36.2.4,1.36.2.5
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Tue Aug 3 17:58:11 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14425/Lib
Modified Files:
Tag: tim-doctest-branch
doctest.py
Log Message:
Use augmented assignment where appropriate. That feature didn't exist
when doctest was first written, and it aids readability.
Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.36.2.4
retrieving revision 1.36.2.5
diff -C2 -d -r1.36.2.4 -r1.36.2.5
*** doctest.py 3 Aug 2004 15:55:29 -0000 1.36.2.4
--- doctest.py 3 Aug 2004 15:58:09 -0000 1.36.2.5
***************
*** 512,516 ****
# Search for an example (a PS1 line).
line = lines[i]
! i = i + 1
m = isPS1(line)
if m is None:
--- 512,516 ----
# Search for an example (a PS1 line).
line = lines[i]
! i += 1
m = isPS1(line)
if m is None:
***************
*** 528,532 ****
(lineno, self.name, self._PS1, line))
! j = j + 1
blanks = m.group(1)
nblanks = len(blanks)
--- 528,532 ----
(lineno, self.name, self._PS1, line))
! j += 1
blanks = m.group(1)
nblanks = len(blanks)
***************
*** 542,546 ****
'has inconsistent leading whitespace: %r' %
(i, self.name, line))
! i = i + 1
else:
break
--- 542,546 ----
'has inconsistent leading whitespace: %r' %
(i, self.name, line))
! i += 1
else:
break
***************
*** 564,568 ****
(i, self.name, line))
want.append(line[nblanks:])
! i = i + 1
line = lines[i]
if isPS1(line) or isEmpty(line):
--- 564,568 ----
(i, self.name, line))
want.append(line[nblanks:])
! i += 1
line = lines[i]
if isPS1(line) or isEmpty(line):
***************
*** 1305,1310 ****
name, (f, t) = x
assert f <= t
! totalt = totalt + t
! totalf = totalf + f
if t == 0:
notests.append(name)
--- 1305,1310 ----
name, (f, t) = x
assert f <= t
! totalt += t
! totalf += f
if t == 0:
notests.append(name)
More information about the Python-checkins
mailing list