[Python-checkins] r70992 - in python/trunk: Doc/library/io.rst Lib/io.py
georg.brandl
python-checkins at python.org
Wed Apr 1 23:00:55 CEST 2009
Author: georg.brandl
Date: Wed Apr 1 23:00:55 2009
New Revision: 70992
Log:
#4572: add SEEK_* values as constants in io.py.
Modified:
python/trunk/Doc/library/io.rst
python/trunk/Lib/io.py
Modified: python/trunk/Doc/library/io.rst
==============================================================================
--- python/trunk/Doc/library/io.rst (original)
+++ python/trunk/Doc/library/io.rst Wed Apr 1 23:00:55 2009
@@ -265,12 +265,18 @@
interpreted relative to the position indicated by *whence*. Values for
*whence* are:
- * ``0`` -- start of the stream (the default); *offset* should be zero or positive
- * ``1`` -- current stream position; *offset* may be negative
- * ``2`` -- end of the stream; *offset* is usually negative
+ * :data:`SEEK_SET` or ``0`` -- start of the stream (the default);
+ *offset* should be zero or positive
+ * :data:`SEEK_CUR` or ``1`` -- current stream position; *offset* may
+ be negative
+ * :data:`SEEK_END` or ``2`` -- end of the stream; *offset* is usually
+ negative
Return the new absolute position.
+ .. versionadded:: 2.7
+ The ``SEEK_*`` constants
+
.. method:: seekable()
Return ``True`` if the stream supports random access. If ``False``,
Modified: python/trunk/Lib/io.py
==============================================================================
--- python/trunk/Lib/io.py (original)
+++ python/trunk/Lib/io.py Wed Apr 1 23:00:55 2009
@@ -66,6 +66,11 @@
# open() uses st_blksize whenever we can
DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes
+# for seek()
+SEEK_SET = 0
+SEEK_CUR = 1
+SEEK_END = 2
+
# py3k has only new style classes
__metaclass__ = type
More information about the Python-checkins
mailing list