mirror of
https://github.com/python/cpython.git
synced 2025-09-12 19:57:40 +00:00
Fix typos in 3.10 "What's new" (GH-25104)
This commit is contained in:
parent
078a3433eb
commit
18701a0608
1 changed files with 4 additions and 4 deletions
|
@ -420,7 +420,7 @@ Several other key features:
|
||||||
- Mapping patterns: ``{"bandwidth": b, "latency": l}`` captures the
|
- Mapping patterns: ``{"bandwidth": b, "latency": l}`` captures the
|
||||||
``"bandwidth"`` and ``"latency"`` values from a dict. Unlike sequence
|
``"bandwidth"`` and ``"latency"`` values from a dict. Unlike sequence
|
||||||
patterns, extra keys are ignored. A wildcard ``**rest`` is also
|
patterns, extra keys are ignored. A wildcard ``**rest`` is also
|
||||||
supported. (But ``**_`` would be redundant, so it not allowed.)
|
supported. (But ``**_`` would be redundant, so is not allowed.)
|
||||||
|
|
||||||
- Subpatterns may be captured using the ``as`` keyword::
|
- Subpatterns may be captured using the ``as`` keyword::
|
||||||
|
|
||||||
|
@ -462,13 +462,13 @@ Optional ``EncodingWarning`` and ``encoding="locale"`` option
|
||||||
The default encoding of :class:`TextIOWrapper` and :func:`open` is
|
The default encoding of :class:`TextIOWrapper` and :func:`open` is
|
||||||
platform and locale dependent. Since UTF-8 is used on most Unix
|
platform and locale dependent. Since UTF-8 is used on most Unix
|
||||||
platforms, omitting ``encoding`` option when opening UTF-8 files
|
platforms, omitting ``encoding`` option when opening UTF-8 files
|
||||||
(e.g. JSON, YAML, TOML, Markdown) is very common bug. For example::
|
(e.g. JSON, YAML, TOML, Markdown) is a very common bug. For example::
|
||||||
|
|
||||||
# BUG: "rb" mode or encoding="utf-8" should be used.
|
# BUG: "rb" mode or encoding="utf-8" should be used.
|
||||||
with open("data.json") as f:
|
with open("data.json") as f:
|
||||||
data = json.laod(f)
|
data = json.load(f)
|
||||||
|
|
||||||
To find this type of bugs, optional ``EncodingWarning`` is added.
|
To find this type of bug, optional ``EncodingWarning`` is added.
|
||||||
It is emitted when :data:`sys.flags.warn_default_encoding <sys.flags>`
|
It is emitted when :data:`sys.flags.warn_default_encoding <sys.flags>`
|
||||||
is true and locale-specific default encoding is used.
|
is true and locale-specific default encoding is used.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue