[Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.15, 1.16

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Thu Aug 7 22:33:21 EDT 2003


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv10183

Modified Files:
	test_itertools.py 
Log Message:
Re-sync doc tests with the doc updates.

Index: test_itertools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** test_itertools.py	29 Jun 2003 20:36:23 -0000	1.15
--- test_itertools.py	8 Aug 2003 04:33:19 -0000	1.16
***************
*** 472,484 ****
  >>> def all(pred, seq):
  ...     "Returns True if pred(x) is True for every element in the iterable"
! ...     return not nth(ifilterfalse(pred, seq), 0)
  
  >>> def some(pred, seq):
  ...     "Returns True if pred(x) is True for at least one element in the iterable"
! ...     return bool(nth(ifilter(pred, seq), 0))
  
  >>> def no(pred, seq):
  ...     "Returns True if pred(x) is False for every element in the iterable"
! ...     return not nth(ifilter(pred, seq), 0)
  
  >>> def padnone(seq):
--- 472,488 ----
  >>> def all(pred, seq):
  ...     "Returns True if pred(x) is True for every element in the iterable"
! ...     return False not in imap(pred, seq)
  
  >>> def some(pred, seq):
  ...     "Returns True if pred(x) is True for at least one element in the iterable"
! ...     return True in imap(pred, seq)
  
  >>> def no(pred, seq):
  ...     "Returns True if pred(x) is False for every element in the iterable"
! ...     return True not in imap(pred, seq)
! 
! >>> def quantify(pred, seq):
! ...     "Count how many times the predicate is True in the sequence"
! ...     return sum(imap(pred, seq))
  
  >>> def padnone(seq):





More information about the Python-checkins mailing list