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

Commit26f1e88

Browse files
[3.13]gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127511)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
1 parent4bafce0 commit26f1e88

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

‎Doc/library/collections.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,10 +783,10 @@ sequence of key-value pairs into a dictionary of lists:
783783

784784
When each key is encountered for the first time, it is not already in the
785785
mapping; so an entry is automatically created using the:attr:`~defaultdict.default_factory`
786-
function which returns an empty:class:`list`. The:meth:`list.append`
786+
function which returns an empty:class:`list`. The:meth:`!list.append`
787787
operation then attaches the value to the new list. When keys are encountered
788788
again, the look-up proceeds normally (returning the list for that key) and the
789-
:meth:`list.append` operation adds another value to the list. This technique is
789+
:meth:`!list.append` operation adds another value to the list. This technique is
790790
simpler and faster than an equivalent technique using:meth:`dict.setdefault`:
791791

792792
>>>d= {}

‎Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ Doc/library/xmlrpc.server.rst
7272
Doc/library/zlib.rst
7373
Doc/reference/compound_stmts.rst
7474
Doc/reference/datamodel.rst
75-
Doc/tutorial/datastructures.rst
7675
Doc/using/windows.rst
7776
Doc/whatsnew/2.4.rst
7877
Doc/whatsnew/2.5.rst

‎Doc/tutorial/datastructures.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ Using Lists as Stacks
142142

143143
The list methods make it very easy to use a list as a stack, where the last
144144
element added is the first element retrieved ("last-in, first-out"). To add an
145-
item to the top of the stack, use:meth:`~list.append`. To retrieve an item from the
146-
top of the stack, use:meth:`~list.pop` without an explicit index. For example::
145+
item to the top of the stack, use:meth:`!~list.append`. To retrieve an item from the
146+
top of the stack, use:meth:`!~list.pop` without an explicit index. For example::
147147

148148
>>> stack = [3, 4, 5]
149149
>>> stack.append(6)
@@ -340,7 +340,7 @@ The :keyword:`!del` statement
340340
=============================
341341

342342
There is a way to remove an item from a list given its index instead of its
343-
value: the:keyword:`del` statement. This differs from the:meth:`~list.pop` method
343+
value: the:keyword:`del` statement. This differs from the:meth:`!~list.pop` method
344344
which returns a value. The:keyword:`!del` statement can also be used to remove
345345
slices from a list or clear the entire list (which we did earlier by assignment
346346
of an empty list to the slice). For example::
@@ -500,8 +500,8 @@ any immutable type; strings and numbers can always be keys. Tuples can be used
500500
as keys if they contain only strings, numbers, or tuples; if a tuple contains
501501
any mutable object either directly or indirectly, it cannot be used as a key.
502502
You can't use lists as keys, since lists can be modified in place using index
503-
assignments, slice assignments, or methods like:meth:`~list.append` and
504-
:meth:`~list.extend`.
503+
assignments, slice assignments, or methods like:meth:`!~list.append` and
504+
:meth:`!~list.extend`.
505505

506506
It is best to think of a dictionary as a set of *key: value* pairs,
507507
with the requirement that the keys are unique (within one dictionary). A pair of

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp