Include a more easily understood example for nullcontext
(cherry picked from commit c287545d62)
Co-authored-by: Daniel Porteous <danielporteous1@gmail.com>
The 'output formatting' section of the tutorial talks a lot about manual formatting with things like .rjust() and .zfill(), with only a passing reference to 3.6's new f-strings.
This doesn't drop all of the old material, but it does rearrange the topics into a more modern order: f-strings first, discussing formatting specifiers a bit; then calling .format(); finally manual formatting with .ljust().
(cherry picked from commit ced350b195)
Co-authored-by: Andrew Kuchling <amk@amk.ca>
Make the change where discussing the CPython implementation of lists and dicts.
(cherry picked from commit 8d41278045)
Co-authored-by: Andrés Delfino <adelfino@gmail.com>
The line is speaking of a list of commands, not the list command.
(cherry picked from commit 7943c5e8b5)
Co-authored-by: Julien Palard <julien@palard.fr>
The line-length limit is not needed because the pages appear in a separate app rather
than on a browser tab. It can also interact badly with the DPI setting.
(cherry picked from commit d824ca7f4d)
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
* `flags` is indeed deprecated, but there is a validation on its value for
backwards compatibility reasons. This adds mention of this in the docs.
* The docs say that `sizehint` is deprecated and ignored, but it is still
used when `epoll_create1()` is unavailable. This adds mention of this in
the docs.
* `sizehint=-1` is acceptable again, and is replaced with `FD_SETSIZE-1`.
This is needed to have a default value available at the Python level,
since `FD_SETSIZE` is not exposed to Python. (see: bpo-31938)
* Reject `sizehint=0` since it is invalid to pass on to `epoll_create()`.
The relevant tests have also been updated.
(cherry picked from commit 0cdf5f4289)
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
it's better to refer to PEP with `pep` role in reStructuredText. It also links to the PEP page.
(cherry picked from commit df748c20da)
Co-authored-by: Behzad B. Mokhtari <35877268+perplexionist@users.noreply.github.com>
Adds references to info about file modes, `time.strftime()`, string formatting
syntaxes, and logging levels.
(cherry picked from commit a8ddf85a84)
Co-authored-by: Andrés Delfino <adelfino@gmail.com>
Mention that it can be triggered by triple quotes and after specifying decorators.
(cherry picked from commit 6868003514)
Co-authored-by: Andrés Delfino <adelfino@gmail.com>
Update the the signature in the code example to make `_cache` a keyword-only parameter.
(cherry picked from commit 2707e41a5c)
Co-authored-by: Noah Haasis <haasis_noah@yahoo.de>
'expresson list' refers to the grammar term 'expression_list' in the subscription production.
(cherry picked from commit 4fddd4e406)
Co-authored-by: Andrés Delfino <adelfino@gmail.com>
string.Formatter auto-numbering feature was added in 3.4 and there
is no versionchanged note in its documentation, making the documentation
ambiguous about which version the feature is available.
(cherry picked from commit b9d8ad5130)
Co-authored-by: Xiang Zhang <angwerzx@126.com>
When attempting to base64-decode a payload of invalid length (1 mod 4),
properly recognize and handle it. The given data will be returned as-is,
i.e. not decoded, along with a new defect, InvalidBase64LengthDefect.
(cherry picked from commit c3f55be7dd)
Co-authored-by: Tal Einat <taleinat+github@gmail.com>