Closes GH-91856.
On Windows double quotes are sometimes better, on Unix usually
single quotes. It's not our place to explain that, so just don't.
(cherry picked from commit 5f8ca1b796)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Add auto exception chaining example to tutorial
(cherry picked from commit 395b66a0ae)
Co-authored-by: Shahriar Heidrich <smheidrich@weltenfunktion.de>
Use SyntaxError invalid range in tutorial introduction example (GH-93031)
Use output from a 3.10+ REPL, showing invalid range, for the
SyntaxError examples in the tutorial introduction page.
Co-authored-by: Eddie Hebert <eddie@eddiehebert.com>
(cherry picked from commit 4b81139aac)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
For the continuation lines, "..." should present as secondary prompt
(cherry picked from commit de28ee8f75)
Co-authored-by: Chenwei Xiao <chanvinxiao@163.com>
Co-authored-by: Chenwei Xiao <chanvinxiao@163.com>
The URL is now https://pyvideo.org, which uses HTTPS and avoids a redirect.
(cherry picked from commit 7c439dca13)
Co-authored-by: partev <petrosyan@gmail.com>
This fixes an issue on tutorial/classes.rst section 9.4 where the example "class Warehouse"
was truncated when pressing the >>> button to hide the prompts and output.
(cherry picked from commit 88f0d0c1e8)
Co-authored-by: Nicolas Haller <nicolas@haller.im>
Add a link to the `match` statement from its section in the tutorial.
Automerge-Triggered-By: GH:Mariatta
(cherry picked from commit 35f55cc5c6)
Co-authored-by: William Andrea <william.j.andrea@gmail.com>
Remove the bit about subclassing exceptions.
Documentation PR can skip the NEWS label.
Automerge-Triggered-By: GH:iritkatriel
(cherry picked from commit 2db5613063)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Updated the output for it=iter(s) from <iterator object at 0x00A1DB50> to <str_iterator object at 0x10c90e650>
(cherry picked from commit c5d18a5014)
Co-authored-by: Vivek Vashist <vivekvashist@gmail.com>
The "Color" example in the pattern-matching section of the "control flow" documentation is not immediately runnable, leading to confusion.
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 1cbb88736c)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Replace old names when they refer to actual versions of macOS.
Keep historical names in references to older versions.
Co-authored-by: Patrick Reader <_@pxeger.com>
(cherry picked from commit 36122e1814)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Broadened scope of the document to explicitly discuss and differentiate between ``__main__.py`` in packages versus the ``__name__ == '__main__'`` expression (and the idioms that surround it), as well as ``import __main__``.
Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
Co-authored-by: Éric Araujo <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7cba23164c)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
This is the last remaining instance, at least for this chapter, in 3.10 & 3.11.
(cherry picked from commit 2f47d8dcc7)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This documents in the tutorial docs the behavior of a finally clause in
case it should re-raise an exception but contains a
return/break/continue statement.
(cherry picked from commit a0b9915a8b)
Co-authored-by: Roberto Hueso <robertohueso96@gmail.com>
Links for 'raise Exception from x' target to 'The raise statement' (7.8) section instead of 'The import statement' (7.11) section.
There are more modified links than in the bug report because I searched some other ones which can get the same improvement.
In the [official tutorial on virtual environment](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments)
> This will create the tutorial-env directory if it doesn’t exist, and also create directories inside it containing a copy of the Python interpreter, **the standard library**, and various supporting files.
According to the actual behavior of `venv` and [PEP 405](https://www.python.org/dev/peps/pep-0405/#id15)'s description about virtual environment, no standard library file is included in the virtual environment's directory.
Automerge-Triggered-By: GH:vsajip