@@ -2129,13 +2129,23 @@ expression support in the :mod:`re` module).
21292129.. method :: str.capitalize()
21302130
21312131 Return a copy of the string with its first character capitalized and the
2132- rest lowercased.
2132+ rest lowercased. For example:
2133+
2134+ .. doctest ::
2135+
2136+ >>> ' PYTHON IS AMAZING' .capitalize()
2137+ 'Python is amazing'
2138+ >>> ' Njemačka starts With a non-ASCII digraph' .capitalize()
2139+ 'Njemačka starts with a non-ascii digraph'
2140+
2141+ See also :meth: `title `.
21332142
21342143 .. versionchanged :: 3.8
21352144 The first character is now put into titlecase rather than uppercase.
21362145 This means that characters like digraphs will only have their first
21372146 letter capitalized, instead of the full character.
21382147
2148+
21392149.. method :: str.casefold()
21402150
21412151 Return a casefolded copy of the string. Casefolded strings may be used for
@@ -3137,7 +3147,7 @@ expression support in the :mod:`re` module).
31373147 >>> titlecase("they're bill's friends.")
31383148 "They're Bill's Friends."
31393149
3140- See also :meth: `istitle `.
3150+ See also :meth: `istitle ` and :meth: ` capitalize ` .
31413151
31423152
31433153.. method :: str.translate(table, /)
@@ -3780,8 +3790,8 @@ objects.
37803790
37813791 If the :class: `bytearray ` needs to shrink, bytes beyond *size * are truncated.
37823792
3783- If the :class: `bytearray ` needs to grow, all new bytes, those beyond * size *,
3784- will be set to null bytes.
3793+ If the :class: `bytearray ` needs to grow, all new bytes will be set to null
3794+ bytes.
37853795
37863796
37873797 This is equivalent to:
@@ -5616,9 +5626,8 @@ Note, the non-operator versions of the :meth:`~set.update`,
56165626argument.
56175627
56185628Note, the *elem * argument to the :meth: `~object.__contains__ `,
5619- :meth: `~set.remove `, and
5620- :meth: `~set.discard ` methods may be a set. To support searching for an equivalent
5621- frozenset, a temporary one is created from *elem *.
5629+ :meth: `~set.remove `, and :meth: `~set.discard ` methods may be a set. In this case,
5630+ an equivalent frozenset is searched for.
56225631
56235632Sets and frozensets are :ref: `generic <generics >` over the type of their elements.
56245633
@@ -5668,7 +5677,7 @@ can be used interchangeably to index the same dictionary entry.
56685677
56695678 * Use a comma-separated list of ``key: value `` pairs within braces:
56705679 ``{'jack': 4098, 'sjoerd': 4127} `` or ``{4098: 'jack', 4127: 'sjoerd'} ``
5671- * Use a dict comprehension: ``{} ``, `` { x: x ** 2 for x in range(10)} ``
5680+ * Use a dict comprehension: ``{x: x ** 2 for x in range(10)} ``
56725681 * Use the type constructor: ``dict() ``,
56735682 ``dict([('foo', 100), ('bar', 200)]) ``, ``dict(foo=100, bar=200) ``
56745683
@@ -5879,9 +5888,8 @@ can be used interchangeably to index the same dictionary entry.
58795888 Return a new view of the dictionary's values. See the
58805889 :ref: `documentation of view objects <dict-views >`.
58815890
5882- An equality comparison between one ``dict.values() `` view and another
5883- will always return ``False ``. This also applies when comparing
5884- ``dict.values() `` to itself::
5891+ An equality comparison between two distinct ``dict.values() `` views
5892+ will always return ``False ``, even for views of the same dictionary::
58855893
58865894 >>> d = {'a': 1}
58875895 >>> d.values() == d.values()
0 commit comments