Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96cbd1e

Browse files
authored
gh-101100: Fix Sphinx warnings forfileno (#111118)
1 parentbe551a7 commit96cbd1e

File tree

8 files changed

+49
-13
lines changed

8 files changed

+49
-13
lines changed

‎Doc/library/bz2.rst

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The :mod:`bz2` module contains:
9191
and:meth:`~io.IOBase.truncate`.
9292
Iteration and the:keyword:`with` statement are supported.
9393

94-
:class:`BZ2File` also provides the followingmethod:
94+
:class:`BZ2File` also provides the followingmethods:
9595

9696
..method::peek([n])
9797

@@ -106,14 +106,52 @@ The :mod:`bz2` module contains:
106106

107107
..versionadded::3.3
108108

109+
..method::fileno()
110+
111+
Return the file descriptor for the underlying file.
112+
113+
..versionadded::3.3
114+
115+
..method::readable()
116+
117+
Return whether the file was opened for reading.
118+
119+
..versionadded::3.3
120+
121+
..method::seekable()
122+
123+
Return whether the file supports seeking.
124+
125+
..versionadded::3.3
126+
127+
..method::writable()
128+
129+
Return whether the file was opened for writing.
130+
131+
..versionadded::3.3
132+
133+
..method::read1(size=-1)
134+
135+
Read up to *size* uncompressed bytes, while trying to avoid
136+
making multiple reads from the underlying stream. Reads up to a
137+
buffer's worth of data if size is negative.
138+
139+
Returns ``b''`` if the file is at EOF.
140+
141+
..versionadded::3.3
142+
143+
..method::readinto(b)
144+
145+
Read bytes into *b*.
146+
147+
Returns the number of bytes read (0 for EOF).
148+
149+
..versionadded::3.3
150+
109151

110152
..versionchanged::3.1
111153
Support for the:keyword:`with` statement was added.
112154

113-
..versionchanged::3.3
114-
The:meth:`fileno`,:meth:`readable`,:meth:`seekable`,:meth:`writable`,
115-
:meth:`read1` and:meth:`readinto` methods were added.
116-
117155
..versionchanged::3.3
118156
Support was added for *filename* being a:term:`file object` instead of an
119157
actual filename.

‎Doc/library/mmap.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ the current file position, and :meth:`seek` through the file to different positi
1919
A memory-mapped file is created by the:class:`~mmap.mmap` constructor, which is
2020
different on Unix and on Windows. In either case you must provide a file
2121
descriptor for a file opened for update. If you wish to map an existing Python
22-
file object, use its:meth:`fileno` method to obtain the correct value for the
22+
file object, use its:meth:`~io.IOBase.fileno` method to obtain the correct value for the
2323
*fileno* parameter. Otherwise, you can open the file using the
2424
:func:`os.open` function, which returns a file descriptor directly (the file
2525
still needs to be closed when done).

‎Doc/library/multiprocessing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2582,7 +2582,7 @@ multiple connections at the same time.
25822582
**Windows**: An item in *object_list* must either be an integer
25832583
handle which is waitable (according to the definition used by the
25842584
documentation of the Win32 function ``WaitForMultipleObjects()``)
2585-
or it can be an object with a:meth:`fileno` method which returns a
2585+
or it can be an object with a:meth:`~io.IOBase.fileno` method which returns a
25862586
socket handle or pipe handle. (Note that pipe handles and socket
25872587
handles are **not** waitable handles.)
25882588

‎Doc/library/selectors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ It defines a :class:`BaseSelector` abstract base class, along with several
2121
concrete implementations (:class:`KqueueSelector`,:class:`EpollSelector`...),
2222
that can be used to wait for I/O readiness notification on multiple file
2323
objects. In the following, "file object" refers to any object with a
24-
:meth:`fileno()` method, or a raw file descriptor. See:term:`file object`.
24+
:meth:`~io.IOBase.fileno` method, or a raw file descriptor. See:term:`file object`.
2525

2626
:class:`DefaultSelector` is an alias to the most efficient implementation
2727
available on the current platform: this should be the default choice for most

‎Doc/library/socket.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
858858
..function::fromfd(fd, family, type, proto=0)
859859

860860
Duplicate the file descriptor *fd* (an integer as returned by a file object's
861-
:meth:`fileno` method) and build a socket object from the result. Address
861+
:meth:`~io.IOBase.fileno` method) and build a socket object from the result. Address
862862
family, socket type and protocol number are as for the:func:`.socket` function
863863
above. The file descriptor should refer to a socket, but this is not checked ---
864864
subsequent operations on the object may fail if the file descriptor is invalid.

‎Doc/library/tempfile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ The module defines the following user-callable items:
147147

148148
This class operates exactly as:func:`TemporaryFile` does, except that
149149
data is spooled in memory until the file size exceeds *max_size*, or
150-
until the file's:func:`fileno` method is called, at which point the
150+
until the file's:func:`~io.IOBase.fileno` method is called, at which point the
151151
contents are written to disk and operation proceeds as with
152152
:func:`TemporaryFile`.
153153

‎Doc/tools/.nitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Doc/library/asyncio-subprocess.rst
3838
Doc/library/asyncio-task.rst
3939
Doc/library/bdb.rst
4040
Doc/library/bisect.rst
41-
Doc/library/bz2.rst
4241
Doc/library/calendar.rst
4342
Doc/library/cmd.rst
4443
Doc/library/collections.abc.rst
@@ -100,7 +99,6 @@ Doc/library/reprlib.rst
10099
Doc/library/resource.rst
101100
Doc/library/rlcompleter.rst
102101
Doc/library/select.rst
103-
Doc/library/selectors.rst
104102
Doc/library/shelve.rst
105103
Doc/library/signal.rst
106104
Doc/library/smtplib.rst

‎Doc/whatsnew/2.5.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ complete list of changes, or look through the SVN logs for all the details.
13471347
:func:`input` function to allow opening files in binary or:term:`universal
13481348
newlines` mode. Another new parameter, *openhook*, lets you use a function
13491349
other than:func:`open` to open the input files. Once you're iterating over
1350-
the set of files, the:class:`FileInput` object's new:meth:`fileno` returns
1350+
the set of files, the:class:`FileInput` object's new:meth:`~fileinput.fileno` returns
13511351
the file descriptor for the currently opened file. (Contributed by Georg
13521352
Brandl.)
13531353

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp