summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-08-06 16:20:26 (GMT)
committerGuido van Rossum <guido@python.org>2002-08-06 16:20:26 (GMT)
commitb57089cdf8b63b38ca736785c9fcc38a9fce89da (patch)
tree3df2d99a25c88233c98e267a3b8b9db94bee90fd /Misc
parent545092b063e235bb81706a296ed18618d4293b87 (diff)
downloadcpython-b57089cdf8b63b38ca736785c9fcc38a9fce89da.zip
cpython-b57089cdf8b63b38ca736785c9fcc38a9fce89da.tar.gz
cpython-b57089cdf8b63b38ca736785c9fcc38a9fce89da.tar.bz2
Files are now their own iterator. The xreadlines method and module
are obsolete.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS12
1 files changed, 12 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 19b3651..3c5c834 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -6,6 +6,16 @@ Type/class unification and new-style classes
Core and builtins
+- File objects are now their own iterators. For a file f, iter(f) now
+ returns f (unless f is closed), and f.next() is similar to
+ f.readline() when EOF is not reached; however, f.next() uses a
+ readahead buffer that messes up the file position, so mixing
+ f.next() and f.readline() (or other methods) doesn't work right.
+ Calling f.seek() drops the readahead buffer, but other operations
+ don't. It so happens that this gives a nice additional speed boost
+ to "for line in file:"; the xreadlines method and corresponding
+ module are now obsolete.
+
- Encoding declarations (PEP 263, phase 1) have been implemented. A
comment of the form "# -*- coding: <encodingname> -*-" in the first
or second line of a Python source file indicates the encoding.
@@ -167,6 +177,8 @@ Core and builtins
Extension modules
+- The xreadlines module is slated for obsolescence.
+
- The strptime function in the time module is now always available (a
Python implementation is used when the C library doesn't define it).