summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-05-01 20:54:30 (GMT)
committerGuido van Rossum <guido@python.org>2001-05-01 20:54:30 (GMT)
commit1031582388eef4d4d54351d56d7683b212f0a3d8 (patch)
tree881de91b3e9853fb97dba72e28a2e8662d100e80 /Misc/NEWS
parentf553f89d45f049e32f5eadc0c78a1e2440745d7a (diff)
downloadcpython-1031582388eef4d4d54351d56d7683b212f0a3d8.zip
cpython-1031582388eef4d4d54351d56d7683b212f0a3d8.tar.gz
cpython-1031582388eef4d4d54351d56d7683b212f0a3d8.tar.bz2
Add more news about iterators.
Diffstat (limited to 'Misc/NEWS')
-rw-r--r--Misc/NEWS12
1 files changed, 12 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index bce3889..f121bac 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -3,6 +3,18 @@ What's New in Python 2.2a0?
Core
+- Dictionary objects now support the "in" operator: "x in dict" means
+ the same as dict.has_key(x).
+
+- Iterators were added; this is a generalized way of providing values
+ to a for loop. See PEP 234. There's a new built-in function iter()
+ to return an iterator. There's a new protocol to get the next value
+ from an iterator using the next() method (in Python) or the
+ tp_iternext slot (in C). There's a new protocol to get iterators
+ using the __iter__() method (in Python) or the tp_iter slot (in C).
+ Iterating (i.e. a for loop) over a dictionary generates its keys.
+ Iterating over a file generates its lines.
+
- The following functions were generalized to work nicely with iterator
arguments:
list()