@@ -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
937945three additional methods and two attributes. To prevent conflicts with
938946field 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
13151325to work with because the underlying dictionary is accessible as an
13161326attribute.
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
0 commit comments