Skip to content

Commit 3e0f278

Browse files
Deploy preview for PR 1214 🛫
1 parent a280cf9 commit 3e0f278

File tree

586 files changed

+752
-695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

586 files changed

+752
-695
lines changed

pr-preview/pr-1214/_sources/library/array.rst.txt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ The module defines the following type:
119119
The length in bytes of one array item in the internal representation.
120120

121121

122-
.. method:: append(x)
122+
.. method:: append(value, /)
123123

124-
Append a new item with value *x* to the end of the array.
124+
Append a new item with the specified value to the end of the array.
125125

126126

127127
.. method:: buffer_info()
@@ -151,20 +151,20 @@ The module defines the following type:
151151
different byte order.
152152

153153

154-
.. method:: count(x)
154+
.. method:: count(value, /)
155155

156-
Return the number of occurrences of *x* in the array.
156+
Return the number of occurrences of *value* in the array.
157157

158158

159-
.. method:: extend(iterable)
159+
.. method:: extend(iterable, /)
160160

161161
Append items from *iterable* to the end of the array. If *iterable* is another
162162
array, it must have *exactly* the same type code; if not, :exc:`TypeError` will
163163
be raised. If *iterable* is not an array, it must be iterable and its elements
164164
must be the right type to be appended to the array.
165165

166166

167-
.. method:: frombytes(buffer)
167+
.. method:: frombytes(buffer, /)
168168

169169
Appends items from the :term:`bytes-like object`, interpreting
170170
its content as an array of machine values (as if it had been read
@@ -174,55 +174,55 @@ The module defines the following type:
174174
:meth:`!fromstring` is renamed to :meth:`frombytes` for clarity.
175175

176176

177-
.. method:: fromfile(f, n)
177+
.. method:: fromfile(f, n, /)
178178

179179
Read *n* items (as machine values) from the :term:`file object` *f* and append
180180
them to the end of the array. If less than *n* items are available,
181181
:exc:`EOFError` is raised, but the items that were available are still
182182
inserted into the array.
183183

184184

185-
.. method:: fromlist(list)
185+
.. method:: fromlist(list, /)
186186

187187
Append items from the list. This is equivalent to ``for x in list:
188188
a.append(x)`` except that if there is a type error, the array is unchanged.
189189

190190

191-
.. method:: fromunicode(s)
191+
.. method:: fromunicode(ustr, /)
192192

193193
Extends this array with data from the given Unicode string.
194194
The array must have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised.
195195
Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an
196196
array of some other type.
197197

198198

199-
.. method:: index(x[, start[, stop]])
199+
.. method:: index(value[, start[, stop]])
200200

201201
Return the smallest *i* such that *i* is the index of the first occurrence of
202-
*x* in the array. The optional arguments *start* and *stop* can be
203-
specified to search for *x* within a subsection of the array. Raise
204-
:exc:`ValueError` if *x* is not found.
202+
*value* in the array. The optional arguments *start* and *stop* can be
203+
specified to search for *value* within a subsection of the array. Raise
204+
:exc:`ValueError` if *value* is not found.
205205

206206
.. versionchanged:: 3.10
207207
Added optional *start* and *stop* parameters.
208208

209209

210-
.. method:: insert(i, x)
210+
.. method:: insert(index, value, /)
211211

212-
Insert a new item with value *x* in the array before position *i*. Negative
212+
Insert a new item *value* in the array before position *index*. Negative
213213
values are treated as being relative to the end of the array.
214214

215215

216-
.. method:: pop([i])
216+
.. method:: pop(index=-1, /)
217217

218218
Removes the item with the index *i* from the array and returns it. The optional
219219
argument defaults to ``-1``, so that by default the last item is removed and
220220
returned.
221221

222222

223-
.. method:: remove(x)
223+
.. method:: remove(value, /)
224224

225-
Remove the first occurrence of *x* from the array.
225+
Remove the first occurrence of *value* from the array.
226226

227227

228228
.. method:: clear()
@@ -247,7 +247,7 @@ The module defines the following type:
247247
:meth:`!tostring` is renamed to :meth:`tobytes` for clarity.
248248

249249

250-
.. method:: tofile(f)
250+
.. method:: tofile(f, /)
251251

252252
Write all items (as machine values) to the :term:`file object` *f*.
253253

pr-preview/pr-1214/_sources/library/collections.rst.txt

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ For example::
240240
[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),
241241
('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]
242242

243-
.. class:: Counter([iterable-or-mapping])
243+
.. class:: Counter(**kwargs)
244+
Counter(iterable, /, **kwargs)
245+
Counter(mapping, /, **kwargs)
244246
245247
A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` objects.
246248
It is a collection where elements are stored as dictionary keys
@@ -290,7 +292,7 @@ For example::
290292
>>> sorted(c.elements())
291293
['a', 'a', 'a', 'a', 'b', 'b']
292294

293-
.. method:: most_common([n])
295+
.. method:: most_common(n=None)
294296

295297
Return a list of the *n* most common elements and their counts from the
296298
most common to the least. If *n* is omitted or ``None``,
@@ -300,7 +302,9 @@ For example::
300302
>>> Counter('abracadabra').most_common(3)
301303
[('a', 5), ('b', 2), ('r', 2)]
302304

303-
.. method:: subtract([iterable-or-mapping])
305+
.. method:: subtract(**kwargs)
306+
subtract(iterable, /, **kwargs)
307+
subtract(mapping, /, **kwargs)
304308
305309
Elements are subtracted from an *iterable* or from another *mapping*
306310
(or counter). Like :meth:`dict.update` but subtracts counts instead
@@ -331,7 +335,9 @@ For example::
331335

332336
This class method is not implemented for :class:`Counter` objects.
333337

334-
.. method:: update([iterable-or-mapping])
338+
.. method:: update(**kwargs)
339+
update(iterable, /, **kwargs)
340+
update(mapping, /, **kwargs)
335341
336342
Elements are counted from an *iterable* or added-in from another
337343
*mapping* (or counter). Like :meth:`dict.update` but adds counts
@@ -477,14 +483,14 @@ or subtracting from an empty counter.
477483

478484
Deque objects support the following methods:
479485

480-
.. method:: append(x)
486+
.. method:: append(item, /)
481487

482-
Add *x* to the right side of the deque.
488+
Add *item* to the right side of the deque.
483489

484490

485-
.. method:: appendleft(x)
491+
.. method:: appendleft(item, /)
486492

487-
Add *x* to the left side of the deque.
493+
Add *item* to the left side of the deque.
488494

489495

490496
.. method:: clear()
@@ -499,38 +505,38 @@ or subtracting from an empty counter.
499505
.. versionadded:: 3.5
500506

501507

502-
.. method:: count(x)
508+
.. method:: count(value, /)
503509

504-
Count the number of deque elements equal to *x*.
510+
Count the number of deque elements equal to *value*.
505511

506512
.. versionadded:: 3.2
507513

508514

509-
.. method:: extend(iterable)
515+
.. method:: extend(iterable, /)
510516

511517
Extend the right side of the deque by appending elements from the iterable
512518
argument.
513519

514520

515-
.. method:: extendleft(iterable)
521+
.. method:: extendleft(iterable, /)
516522

517523
Extend the left side of the deque by appending elements from *iterable*.
518524
Note, the series of left appends results in reversing the order of
519525
elements in the iterable argument.
520526

521527

522-
.. method:: index(x[, start[, stop]])
528+
.. method:: index(value[, start[, stop]])
523529

524-
Return the position of *x* in the deque (at or after index *start*
530+
Return the position of *value* in the deque (at or after index *start*
525531
and before index *stop*). Returns the first match or raises
526532
:exc:`ValueError` if not found.
527533

528534
.. versionadded:: 3.5
529535

530536

531-
.. method:: insert(i, x)
537+
.. method:: insert(index, value, /)
532538

533-
Insert *x* into the deque at position *i*.
539+
Insert *value* into the deque at position *index*.
534540

535541
If the insertion would cause a bounded deque to grow beyond *maxlen*,
536542
an :exc:`IndexError` is raised.
@@ -550,7 +556,7 @@ or subtracting from an empty counter.
550556
elements are present, raises an :exc:`IndexError`.
551557

552558

553-
.. method:: remove(value)
559+
.. method:: remove(value, /)
554560

555561
Remove the first occurrence of *value*. If not found, raises a
556562
:exc:`ValueError`.
@@ -563,7 +569,7 @@ or subtracting from an empty counter.
563569
.. versionadded:: 3.2
564570

565571

566-
.. method:: rotate(n=1)
572+
.. method:: rotate(n=1, /)
567573

568574
Rotate the deque *n* steps to the right. If *n* is negative, rotate
569575
to the left.
@@ -715,7 +721,9 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
715721
:class:`defaultdict` objects
716722
----------------------------
717723

718-
.. class:: defaultdict(default_factory=None, /, [...])
724+
.. class:: defaultdict(default_factory=None, /, **kwargs)
725+
defaultdict(default_factory, mapping, /, **kwargs)
726+
defaultdict(default_factory, iterable, /, **kwargs)
719727
720728
Return a new dictionary-like object. :class:`defaultdict` is a subclass of the
721729
built-in :class:`dict` class. It overrides one method and adds one writable
@@ -731,7 +739,7 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
731739
:class:`defaultdict` objects support the following method in addition to the
732740
standard :class:`dict` operations:
733741

734-
.. method:: __missing__(key)
742+
.. method:: __missing__(key, /)
735743

736744
If the :attr:`default_factory` attribute is ``None``, this raises a
737745
:exc:`KeyError` exception with the *key* as argument.
@@ -937,7 +945,7 @@ In addition to the methods inherited from tuples, named tuples support
937945
three additional methods and two attributes. To prevent conflicts with
938946
field names, the method and attribute names start with an underscore.
939947

940-
.. classmethod:: somenamedtuple._make(iterable)
948+
.. classmethod:: somenamedtuple._make(iterable, /)
941949

942950
Class method that makes a new instance from an existing sequence or iterable.
943951

@@ -1134,7 +1142,9 @@ Some differences from :class:`dict` still remain:
11341142
* Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method.
11351143

11361144

1137-
.. class:: OrderedDict([items])
1145+
.. class:: OrderedDict(**kwargs)
1146+
OrderedDict(mapping, /, **kwargs)
1147+
OrderedDict(iterable, /, **kwargs)
11381148
11391149
Return an instance of a :class:`dict` subclass that has methods
11401150
specialized for rearranging dictionary order.
@@ -1315,16 +1325,17 @@ subclass directly from :class:`dict`; however, this class can be easier
13151325
to work with because the underlying dictionary is accessible as an
13161326
attribute.
13171327

1318-
.. class:: UserDict([initialdata])
1328+
.. class:: UserDict(**kwargs)
1329+
UserDict(mapping, /, **kwargs)
1330+
UserDict(iterable, /, **kwargs)
13191331
13201332
Class that simulates a dictionary. The instance's contents are kept in a
13211333
regular dictionary, which is accessible via the :attr:`data` attribute of
1322-
:class:`UserDict` instances. If *initialdata* is provided, :attr:`data` is
1323-
initialized with its contents; note that a reference to *initialdata* will not
1324-
be kept, allowing it to be used for other purposes.
1334+
:class:`!UserDict` instances. If arguments are provided, they are used to
1335+
initialize :attr:`data`, like a regular dictionary.
13251336

13261337
In addition to supporting the methods and operations of mappings,
1327-
:class:`UserDict` instances provide the following attribute:
1338+
:class:`!UserDict` instances provide the following attribute:
13281339

13291340
.. attribute:: data
13301341

pr-preview/pr-1214/_sources/library/signal.rst.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ The variables defined in the :mod:`!signal` module are:
230230

231231
Stop executing (cannot be caught or ignored).
232232

233+
.. availability:: Unix.
234+
233235
.. data:: SIGSTKFLT
234236

235237
Stack fault on coprocessor. The Linux kernel does not raise this signal: it

pr-preview/pr-1214/_sources/library/stdtypes.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,13 +1163,13 @@ Sequence types also support the following methods:
11631163

11641164
Return the total number of occurrences of *value* in *sequence*.
11651165

1166-
.. method:: list.index(value[, start[, stop])
1167-
range.index(value[, start[, stop])
1168-
tuple.index(value[, start[, stop])
1166+
.. method:: list.index(value[, start[, stop]])
1167+
range.index(value[, start[, stop]])
1168+
tuple.index(value[, start[, stop]])
11691169
:no-contents-entry:
11701170
:no-index-entry:
11711171
:no-typesetting:
1172-
.. method:: sequence.index(value[, start[, stop])
1172+
.. method:: sequence.index(value[, start[, stop]])
11731173

11741174
Return the index of the first occurrence of *value* in *sequence*.
11751175

pr-preview/pr-1214/_sources/tutorial/datastructures.rst.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@ More on Lists
1515
The :ref:`list <typesseq-list>` data type has some more methods. Here are all
1616
of the methods of list objects:
1717

18-
.. method:: list.append(x)
18+
.. method:: list.append(value, /)
1919
:noindex:
2020

2121
Add an item to the end of the list. Similar to ``a[len(a):] = [x]``.
2222

2323

24-
.. method:: list.extend(iterable)
24+
.. method:: list.extend(iterable, /)
2525
:noindex:
2626

2727
Extend the list by appending all the items from the iterable. Similar to
2828
``a[len(a):] = iterable``.
2929

3030

31-
.. method:: list.insert(i, x)
31+
.. method:: list.insert(index, value, /)
3232
:noindex:
3333

3434
Insert an item at a given position. The first argument is the index of the
3535
element before which to insert, so ``a.insert(0, x)`` inserts at the front of
3636
the list, and ``a.insert(len(a), x)`` is equivalent to ``a.append(x)``.
3737

3838

39-
.. method:: list.remove(x)
39+
.. method:: list.remove(value, /)
4040
:noindex:
4141

42-
Remove the first item from the list whose value is equal to *x*. It raises a
42+
Remove the first item from the list whose value is equal to *value*. It raises a
4343
:exc:`ValueError` if there is no such item.
4444

4545

46-
.. method:: list.pop([i])
46+
.. method:: list.pop(index=-1, /)
4747
:noindex:
4848

4949
Remove the item at the given position in the list, and return it. If no index
@@ -58,10 +58,10 @@ of the methods of list objects:
5858
Remove all items from the list. Similar to ``del a[:]``.
5959

6060

61-
.. method:: list.index(x[, start[, end]])
61+
.. method:: list.index(value[, start[, stop]])
6262
:noindex:
6363

64-
Return zero-based index of the first occurrence of *x* in the list.
64+
Return zero-based index of the first occurrence of *value* in the list.
6565
Raises a :exc:`ValueError` if there is no such item.
6666

6767
The optional arguments *start* and *end* are interpreted as in the slice
@@ -70,10 +70,10 @@ of the methods of list objects:
7070
sequence rather than the *start* argument.
7171

7272

73-
.. method:: list.count(x)
73+
.. method:: list.count(value, /)
7474
:noindex:
7575

76-
Return the number of times *x* appears in the list.
76+
Return the number of times *value* appears in the list.
7777

7878

7979
.. method:: list.sort(*, key=None, reverse=False)

0 commit comments

Comments
 (0)