[Python-Dev] [Python-checkins] cpython: Close #10142: Support for SEEK_HOLE/SEEK_DATA
Benjamin Peterson
benjamin at python.org
Thu Apr 26 17:00:15 CEST 2012
2012年4月26日 jesus.cea <python-checkins at python.org>:
> http://hg.python.org/cpython/rev/86dc014cdd74
> changeset: 76570:86dc014cdd74
> user: Jesus Cea <jcea at jcea.es>
> date: Thu Apr 26 16:39:35 2012 +0200
> summary:
> Close #10142: Support for SEEK_HOLE/SEEK_DATA
>> files:
> Doc/library/io.rst | 5 +++++
> Doc/library/os.rst | 4 ++++
> Lib/_pyio.py | 12 +++---------
> Lib/os.py | 1 +
> Lib/test/test_posix.py | 20 ++++++++++++++++++++
> Misc/NEWS | 2 ++
> Modules/_io/bufferedio.c | 21 ++++++++++++++++++---
> Modules/posixmodule.c | 7 +++++++
> 8 files changed, 60 insertions(+), 12 deletions(-)
>>> diff --git a/Doc/library/io.rst b/Doc/library/io.rst
> --- a/Doc/library/io.rst
> +++ b/Doc/library/io.rst
> @@ -291,6 +291,11 @@
> .. versionadded:: 3.1
> The ``SEEK_*`` constants.
>> + .. versionadded:: 3.3
> + Some operating systems could support additional values, like
> + :data:`os.SEEK_HOLE` or :data:`os.SEEK_DATA`. The valid values
> + for a file could depend on it being open in text or binary mode.
> +
Why are they only listed in "os" and not "io".
> .. method:: seekable()
>> Return ``True`` if the stream supports random access. If ``False``,
> diff --git a/Doc/library/os.rst b/Doc/library/os.rst
> --- a/Doc/library/os.rst
> +++ b/Doc/library/os.rst
> @@ -992,6 +992,10 @@
> Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
> respectively. Availability: Windows, Unix.
>> + .. versionadded:: 3.3
> + Some operating systems could support additional values, like
"Some operating systems may support" is better. (They applies to other
parts in the docs, too.)
> + :data:`os.SEEK_HOLE` or :data:`os.SEEK_DATA`.
> +
Since we're explicitly listing which ones we support, it would be nice
to explain what they do.
--
Regards,
Benjamin
More information about the Python-Dev
mailing list