@@ -237,7 +237,9 @@ For example::
237237 [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),
238238 ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]
239239
240- .. class :: Counter([iterable-or-mapping])
240+ .. class :: Counter(**kwargs)
241+ Counter(iterable, /, **kwargs)
242+ Counter(mapping, /, **kwargs)
241243
242244 A :class: `Counter ` is a :class: `dict ` subclass for counting :term: `hashable ` objects.
243245 It is a collection where elements are stored as dictionary keys
@@ -287,7 +289,7 @@ For example::
287289 >>> sorted (c.elements())
288290 ['a', 'a', 'a', 'a', 'b', 'b']
289291
290- .. method :: most_common([n] )
292+ .. method :: most_common(n=None )
291293
292294 Return a list of the *n * most common elements and their counts from the
293295 most common to the least. If *n * is omitted or ``None ``,
@@ -297,7 +299,9 @@ For example::
297299 >>> Counter(' abracadabra' ).most_common(3 )
298300 [('a', 5), ('b', 2), ('r', 2)]
299301
300- .. method :: subtract([iterable-or-mapping])
302+ .. method :: subtract(**kwargs)
303+ subtract(iterable, /, **kwargs)
304+ subtract(mapping, /, **kwargs)
301305
302306 Elements are subtracted from an *iterable * or from another *mapping *
303307 (or counter). Like :meth: `dict.update ` but subtracts counts instead
@@ -328,7 +332,9 @@ For example::
328332
329333 This class method is not implemented for :class: `Counter ` objects.
330334
331- .. method :: update([iterable-or-mapping])
335+ .. method :: update(**kwargs)
336+ update(iterable, /, **kwargs)
337+ update(mapping, /, **kwargs)
332338
333339 Elements are counted from an *iterable * or added-in from another
334340 *mapping * (or counter). Like :meth: `dict.update ` but adds counts
@@ -481,14 +487,14 @@ or subtracting from an empty counter.
481487
482488 Deque objects support the following methods:
483489
484- .. method :: append(x )
490+ .. method :: append(item, / )
485491
486- Add *x * to the right side of the deque.
492+ Add *item * to the right side of the deque.
487493
488494
489- .. method :: appendleft(x )
495+ .. method :: appendleft(item, / )
490496
491- Add *x * to the left side of the deque.
497+ Add *item * to the left side of the deque.
492498
493499
494500 .. method :: clear()
@@ -503,38 +509,38 @@ or subtracting from an empty counter.
503509 .. versionadded :: 3.5
504510
505511
506- .. method :: count(x )
512+ .. method :: count(value, / )
507513
508- Count the number of deque elements equal to *x *.
514+ Count the number of deque elements equal to *value *.
509515
510516 .. versionadded :: 3.2
511517
512518
513- .. method :: extend(iterable)
519+ .. method :: extend(iterable, / )
514520
515521 Extend the right side of the deque by appending elements from the iterable
516522 argument.
517523
518524
519- .. method :: extendleft(iterable)
525+ .. method :: extendleft(iterable, / )
520526
521527 Extend the left side of the deque by appending elements from *iterable *.
522528 Note, the series of left appends results in reversing the order of
523529 elements in the iterable argument.
524530
525531
526- .. method :: index(x [, start[, stop]])
532+ .. method :: index(value [, start[, stop]])
527533
528- Return the position of *x * in the deque (at or after index *start *
534+ Return the position of *value * in the deque (at or after index *start *
529535 and before index *stop *). Returns the first match or raises
530536 :exc: `ValueError ` if not found.
531537
532538 .. versionadded :: 3.5
533539
534540
535- .. method :: insert(i, x )
541+ .. method :: insert(index, value, / )
536542
537- Insert *x * into the deque at position *i *.
543+ Insert *value * into the deque at position *index *.
538544
539545 If the insertion would cause a bounded deque to grow beyond *maxlen *,
540546 an :exc: `IndexError ` is raised.
@@ -554,7 +560,7 @@ or subtracting from an empty counter.
554560 elements are present, raises an :exc: `IndexError `.
555561
556562
557- .. method :: remove(value)
563+ .. method :: remove(value, / )
558564
559565 Remove the first occurrence of *value *. If not found, raises a
560566 :exc: `ValueError `.
@@ -567,7 +573,7 @@ or subtracting from an empty counter.
567573 .. versionadded :: 3.2
568574
569575
570- .. method :: rotate(n=1)
576+ .. method :: rotate(n=1, / )
571577
572578 Rotate the deque *n * steps to the right. If *n * is negative, rotate
573579 to the left.
@@ -719,7 +725,9 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
719725:class: `defaultdict ` objects
720726----------------------------
721727
722- .. class :: defaultdict(default_factory=None, /, [...])
728+ .. class :: defaultdict(default_factory=None, /, **kwargs)
729+ defaultdict(default_factory, mapping, /, **kwargs)
730+ defaultdict(default_factory, iterable, /, **kwargs)
723731
724732 Return a new dictionary-like object. :class: `defaultdict ` is a subclass of the
725733 built-in :class: `dict ` class. It overrides one method and adds one writable
@@ -735,7 +743,7 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
735743 :class: `defaultdict ` objects support the following method in addition to the
736744 standard :class: `dict ` operations:
737745
738- .. method :: __missing__(key)
746+ .. method :: __missing__(key, / )
739747
740748 If the :attr: `default_factory ` attribute is ``None ``, this raises a
741749 :exc: `KeyError ` exception with the *key * as argument.
@@ -941,7 +949,7 @@ In addition to the methods inherited from tuples, named tuples support
941949three additional methods and two attributes. To prevent conflicts with
942950field names, the method and attribute names start with an underscore.
943951
944- .. classmethod :: somenamedtuple._make(iterable)
952+ .. classmethod :: somenamedtuple._make(iterable, / )
945953
946954 Class method that makes a new instance from an existing sequence or iterable.
947955
@@ -1138,7 +1146,9 @@ Some differences from :class:`dict` still remain:
11381146* Until Python 3.8, :class: `dict ` lacked a :meth: `~object.__reversed__ ` method.
11391147
11401148
1141- .. class :: OrderedDict([items])
1149+ .. class :: OrderedDict(**kwargs)
1150+ OrderedDict(mapping, /, **kwargs)
1151+ OrderedDict(iterable, /, **kwargs)
11421152
11431153 Return an instance of a :class: `dict ` subclass that has methods
11441154 specialized for rearranging dictionary order.
@@ -1319,16 +1329,17 @@ subclass directly from :class:`dict`; however, this class can be easier
13191329to work with because the underlying dictionary is accessible as an
13201330attribute.
13211331
1322- .. class :: UserDict([initialdata])
1332+ .. class :: UserDict(**kwargs)
1333+ UserDict(mapping, /, **kwargs)
1334+ UserDict(iterable, /, **kwargs)
13231335
13241336 Class that simulates a dictionary. The instance's contents are kept in a
13251337 regular dictionary, which is accessible via the :attr: `data ` attribute of
1326- :class: `UserDict ` instances. If *initialdata * is provided, :attr: `data ` is
1327- initialized with its contents; note that a reference to *initialdata * will not
1328- be kept, allowing it to be used for other purposes.
1338+ :class: `!UserDict ` instances. If arguments are provided, they are used to
1339+ initialize :attr: `data `, like a regular dictionary.
13291340
13301341 In addition to supporting the methods and operations of mappings,
1331- :class: `UserDict ` instances provide the following attribute:
1342+ :class: `! UserDict ` instances provide the following attribute:
13321343
13331344 .. attribute :: data
13341345
0 commit comments