diff options
author | Guido van Rossum <guido@python.org> | 1993-11-30 13:43:54 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-11-30 13:43:54 +0000 |
commit | ae3b3a33d85134b51505b3f0f3fdaf6afbffa79b (patch) | |
tree | ed5f31c45378ce3be6e096f559fa645ea5f02a42 /Lib/test/test_b2.py | |
parent | 590baa4a7a43b596119b47f605e3e570c2b3b0ee (diff) | |
download | cpython-git-ae3b3a33d85134b51505b3f0f3fdaf6afbffa79b.tar.gz |
* test_*.py: new lambda syntax (also affects tests for filter, map,
reduce)
* ftplib.py: added default callback for retrlines; added dir() method
* ftplib.py: don't return self in self.connect(); added hack so that if
'CDUP' is not understood, 'CWD ..' is tried.
* ftplib.py: second method called init() should have been called
connect(); if __init__ sees more than one argument, it will also try to
login().
Diffstat (limited to 'Lib/test/test_b2.py')
-rw-r--r-- | Lib/test/test_b2.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_b2.py b/Lib/test/test_b2.py index 037955ea15..7118b08bfd 100644 --- a/Lib/test/test_b2.py +++ b/Lib/test/test_b2.py @@ -112,13 +112,14 @@ finally: fp.close() print 'reduce' -if reduce('x,y:x+y', ['a', 'b', 'c'], '') <> 'abc': +if reduce(lambda x, y: x+y, ['a', 'b', 'c'], '') <> 'abc': raise TestFailed, 'reduce(): implode a string' -if reduce('x,y:x+y', [['a', 'c'], [], ['d', 'w']], []) <> ['a','c','d','w']: +if reduce(lambda x, y: x+y, + [['a', 'c'], [], ['d', 'w']], []) <> ['a','c','d','w']: raise TestFailed, 'reduce(): append' -if reduce('x,y: x*y', range(2,8), 1) <> 5040: +if reduce(lambda x, y: x*y, range(2,8), 1) <> 5040: raise TestFailed, 'reduce(): compute 7!' -if reduce('x,y:x*y', range(2,21), 1L) <> 2432902008176640000L: +if reduce(lambda x, y: x*y, range(2,21), 1L) <> 2432902008176640000L: raise TestFailed, 'reduce(): compute 20!, use long' print 'reload' |