Guido van Rossum
59d1d2b434
Iterators phase 1. This comprises:
...
new slot tp_iter in type object, plus new flag Py_TPFLAGS_HAVE_ITER
new C API PyObject_GetIter(), calls tp_iter
new builtin iter(), with two forms: iter(obj), and iter(function, sentinel)
new internal object types iterobject and calliterobject
new exception StopIteration
new opcodes for "for" loops, GET_ITER and FOR_ITER (also supported by dis.py)
new magic number for .pyc files
new special method for instances: __iter__() returns an iterator
iteration over dictionaries: "for x in dict" iterates over the keys
iteration over files: "for x in file" iterates over lines
TODO:
documentation
test suite
decide whether to use a different way to spell iter(function, sentinal)
decide whether "for key in dict" is a good idea
use iterators in map/filter/reduce, min/max, and elsewhere (in/not in?)
speed tuning (make next() a slot tp_next???)
2001-04-20 19:13:02 +00:00
..
2001-04-12 21:54:41 +00:00
2001-04-05 16:08:41 +00:00
2001-04-14 16:17:00 +00:00
2001-01-03 21:29:14 +00:00
2000-09-24 06:29:50 +00:00
2001-02-09 16:34:24 +00:00
2001-04-10 21:13:06 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2000-10-09 19:34:12 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-02-27 21:35:40 +00:00
2001-04-10 22:07:43 +00:00
2001-02-02 02:51:21 +00:00
2001-02-27 21:35:40 +00:00
2001-04-11 23:43:09 +00:00
2000-03-31 20:03:56 +00:00
2001-04-20 16:50:40 +00:00
2001-04-05 14:41:30 +00:00
2001-03-15 10:45:44 +00:00
2001-01-20 19:54:20 +00:00
2001-02-18 03:30:53 +00:00
2001-04-08 07:23:44 +00:00
2001-04-20 19:04:55 +00:00
2001-01-21 03:40:37 +00:00
2001-01-20 19:54:20 +00:00
2001-01-20 19:54:20 +00:00
2001-02-09 05:38:46 +00:00
2001-01-20 19:54:20 +00:00
2001-04-08 15:05:16 +00:00
2001-02-10 00:06:00 +00:00
2001-02-18 03:30:53 +00:00
2001-01-20 19:54:20 +00:00
2001-03-19 13:40:44 +00:00
2001-02-09 12:10:26 +00:00
2001-04-15 12:40:13 +00:00
2001-03-22 21:59:20 +00:00
2001-02-09 08:56:30 +00:00
2001-01-20 19:54:20 +00:00
2001-04-08 00:43:13 +00:00
2001-01-20 19:54:20 +00:00
2001-01-20 19:54:20 +00:00
2001-04-18 01:20:21 +00:00
2001-02-26 21:55:34 +00:00
2001-04-06 19:39:11 +00:00
2001-01-20 19:54:20 +00:00
2001-01-20 19:54:20 +00:00
2001-01-25 13:47:00 +00:00
2001-02-20 11:24:35 +00:00
2001-03-16 08:29:48 +00:00
2001-04-20 19:13:02 +00:00
2001-03-21 23:07:59 +00:00
2001-01-20 23:34:12 +00:00
2001-03-02 06:43:49 +00:00
2001-01-20 23:34:12 +00:00
2001-01-20 23:34:12 +00:00
2001-03-21 18:05:48 +00:00
2001-02-09 11:10:16 +00:00
2001-01-20 23:34:12 +00:00
2001-04-09 04:31:50 +00:00
2001-01-20 23:34:12 +00:00
2001-02-27 21:23:31 +00:00
2001-01-23 15:35:05 +00:00
2001-01-20 23:34:12 +00:00
2001-02-09 10:10:02 +00:00
2001-03-20 15:51:14 +00:00
2001-02-18 03:30:53 +00:00
2001-02-09 08:25:29 +00:00
2001-04-13 14:57:08 +00:00
2001-02-09 10:18:37 +00:00
2001-02-22 13:24:27 +00:00
2001-01-24 06:27:27 +00:00
2001-04-07 16:05:24 +00:00
2001-04-13 14:04:02 +00:00
2001-02-09 09:10:35 +00:00
2001-02-09 09:48:45 +00:00
2001-01-24 06:27:27 +00:00
2001-04-16 16:04:10 +00:00
2001-01-24 06:27:27 +00:00
2001-02-09 09:48:45 +00:00
2001-04-15 13:32:27 +00:00
2001-02-09 10:23:55 +00:00
2001-02-10 00:22:33 +00:00
2001-02-23 20:04:54 +00:00
2001-02-09 09:44:47 +00:00
2001-02-09 09:39:08 +00:00
2001-04-10 15:42:02 +00:00
2001-03-12 02:56:15 +00:00
2001-02-18 03:30:53 +00:00
2001-04-15 12:51:42 +00:00
2001-02-09 07:02:17 +00:00
2001-02-06 01:07:02 +00:00
2001-02-18 03:30:53 +00:00
2001-03-07 09:05:45 +00:00
2001-02-09 23:28:07 +00:00
2001-04-10 05:02:52 +00:00
2001-02-07 23:14:30 +00:00
2001-02-09 20:06:00 +00:00
2001-02-12 02:00:42 +00:00
2001-04-10 15:44:33 +00:00
2001-04-16 18:12:04 +00:00
2001-02-12 02:00:42 +00:00
2001-03-10 09:33:14 +00:00
2001-03-14 20:01:19 +00:00
2001-04-14 15:16:05 +00:00
2001-02-12 02:00:42 +00:00
2001-02-12 02:00:42 +00:00
2001-02-12 02:00:42 +00:00
2001-04-13 15:04:32 +00:00
2001-02-18 03:30:53 +00:00
2001-03-22 22:30:21 +00:00
2001-02-15 23:56:39 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-18 03:30:53 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 23:56:39 +00:00
2001-02-15 22:15:14 +00:00
2001-04-15 13:01:41 +00:00
2001-02-15 22:15:14 +00:00
2001-04-17 17:20:19 +00:00
2001-02-15 22:15:14 +00:00
2001-02-09 10:26:06 +00:00
2001-03-23 17:53:49 +00:00
2001-04-15 13:06:04 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-03-29 04:36:09 +00:00
2001-04-11 04:02:05 +00:00
2001-03-22 15:50:10 +00:00
2001-03-22 15:50:10 +00:00
2001-03-22 15:50:10 +00:00
2001-03-22 15:50:10 +00:00
2001-02-18 03:30:53 +00:00
2001-02-15 22:15:14 +00:00
2001-02-18 03:30:53 +00:00
2001-02-18 03:30:53 +00:00
2001-02-09 13:37:37 +00:00
2001-02-09 20:18:41 +00:00
2001-01-15 01:36:40 +00:00
2001-01-15 01:36:40 +00:00
2000-08-24 21:08:39 +00:00
2001-04-16 18:43:18 +00:00
2001-04-08 00:38:42 +00:00
2001-03-01 04:27:19 +00:00
2001-03-02 05:51:16 +00:00
2001-02-27 21:51:47 +00:00
2001-04-02 20:15:57 +00:00
2001-03-01 04:27:19 +00:00
2001-02-10 00:22:33 +00:00
2001-03-23 05:22:49 +00:00
2001-03-29 04:36:09 +00:00
2001-03-01 04:27:19 +00:00
2000-03-10 23:18:11 +00:00
2001-03-20 18:36:48 +00:00
2001-04-15 09:18:32 +00:00
2001-04-15 13:08:01 +00:00
2001-04-15 20:47:33 +00:00
2001-03-01 04:27:19 +00:00
2000-03-30 15:00:33 +00:00
2001-02-18 03:30:53 +00:00
2001-02-18 03:30:53 +00:00
2001-01-20 19:54:20 +00:00
2001-03-01 04:27:19 +00:00
2001-03-01 04:27:19 +00:00
2001-03-01 04:27:19 +00:00
2001-04-19 16:26:06 +00:00
2001-04-12 22:07:27 +00:00
2001-03-16 08:29:48 +00:00
2001-01-15 03:34:38 +00:00
2001-03-01 04:27:19 +00:00
2001-03-14 17:03:30 +00:00
2001-04-14 16:45:14 +00:00