summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_enumerate.py
Commit message (Collapse)AuthorAgeFilesLines
* Merged revisions 55007-55179 via svnmerge fromGuido van Rossum2007-05-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55077 | guido.van.rossum | 2007-05-02 11:54:37 -0700 (Wed, 02 May 2007) | 2 lines Use the new print syntax, at least. ........ r55142 | fred.drake | 2007-05-04 21:27:30 -0700 (Fri, 04 May 2007) | 1 line remove old cruftiness ........ r55143 | fred.drake | 2007-05-04 21:52:16 -0700 (Fri, 04 May 2007) | 1 line make this work with the new Python ........ r55162 | neal.norwitz | 2007-05-06 22:29:18 -0700 (Sun, 06 May 2007) | 1 line Get asdl code gen working with Python 2.3. Should continue to work with 3.0 ........ r55164 | neal.norwitz | 2007-05-07 00:00:38 -0700 (Mon, 07 May 2007) | 1 line Verify checkins to p3yk (sic) branch go to 3000 list. ........ r55166 | neal.norwitz | 2007-05-07 00:12:35 -0700 (Mon, 07 May 2007) | 1 line Fix this test so it runs again by importing warnings_test properly. ........ r55167 | neal.norwitz | 2007-05-07 01:03:22 -0700 (Mon, 07 May 2007) | 8 lines So long xrange. range() now supports values that are outside -sys.maxint to sys.maxint. floats raise a TypeError. This has been sitting for a long time. It probably has some problems and needs cleanup. Objects/rangeobject.c now uses 4-space indents since it is almost completely new. ........ r55171 | guido.van.rossum | 2007-05-07 10:21:26 -0700 (Mon, 07 May 2007) | 4 lines Fix two tests that were previously depending on significant spaces at the end of a line (and before that on Python 2.x print behavior that has no exact equivalent in 3.0). ........
* PEP 3114: rename .next() to .__next__() and add next() builtin.Georg Brandl2007-04-211-7/+7
|
* Fix most trivially-findable print statements.Guido van Rossum2007-02-091-1/+1
| | | | | | | | | There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
* Make built-in zip() equal to itertools.izip().Guido van Rossum2006-08-241-1/+1
| | | | | | | I mea, *really* equal -- for now, the implementation just imports itertools. :-) The only other changes necessary were various unit tests that were assuming zip() returns a real list. No "real" code made this assumption.
* Adjust test_enumerate to accomodate for iter() blowing up sooner thanThomas Wouters2006-04-151-1/+1
| | | | expected, when dealing with new-style broken-iterators.
* Convert iterator __len__() methods to a private API.Raymond Hettinger2005-09-241-0/+1
|
* Whitespace normalization.Tim Peters2005-07-171-1/+1
|
* Fix:Michael W. Hudson2005-07-121-0/+20
| | | | | | | [ 1229429 ] missing Py_DECREF in PyObject_CallMethod Add a test in test_enumerate, which is a bit random, but suffices (reversed_new calls PyObject_CallMethod under some circumstances).
* Improve test coverage.Raymond Hettinger2004-09-291-0/+29
|
* Use floor division operator.Raymond Hettinger2004-09-271-1/+1
|
* Tidied up the implementations of reversed (including the custom onesRaymond Hettinger2004-03-101-2/+2
| | | | | | | | | | | | | | | | | for xrange and list objects). * list.__reversed__ now checks the length of the sequence object before calling PyList_GET_ITEM() because the mutable could have changed length. * all three implementations are now tranparent with respect to length and maintain the invariant len(it) == len(list(it)) even when the underlying sequence mutates. * __builtin__.reversed() now frees the underlying sequence as soon as the iterator is exhausted. * the code paths were rearranged so that the most common paths do not require a jump.
* Eliminate the double reverse option. It's only use caseRaymond Hettinger2004-03-101-4/+1
| | | | was academic and it was potentially confusing to use.
* Make reversed() transparent with respect to length.Raymond Hettinger2004-02-101-0/+4
|
* Let reversed() work with itself.Raymond Hettinger2004-02-081-0/+4
|
* * Migrate set() and frozenset() from the sandbox.Raymond Hettinger2003-11-161-3/+2
| | | | | | | | * Install the unittests, docs, newsitem, include file, and makefile update. * Exercise the new functions whereever sets.py was being used. Includes the docs for libfuncs.tex. Separate docs for the types are forthcoming.
* Implement and apply PEP 322, reverse iterationRaymond Hettinger2003-11-061-1/+19
|
* Fix typo so that the test actually calls the tested function.Raymond Hettinger2003-05-291-1/+1
|
* * Beefed-up testsRaymond Hettinger2003-05-281-14/+45
| | | | | * Allow tuple re-use * Call tp_iternext directly
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-7/+1
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Removed the generator future-stmt -- not needed for 2.3.Tim Peters2002-06-201-1/+0
|
* - New builtin function enumerate(x), from PEP 279. Example:Guido van Rossum2002-04-261-0/+118
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c"). The argument can be an arbitrary iterable object.