Commit graph

705 commits

Author SHA1 Message Date
Miss Islington (bot)
f79cfb6625
[doc] Fix error in tutorial example: type(exc) is the type rather than the instance (GH-102751)
(cherry picked from commit 8709697292)

Co-authored-by: Jens-Hilmar Bradt <17177271+jenshb@users.noreply.github.com>
2023-03-22 11:51:48 -07:00
Miss Islington (bot)
a166cb4131
gh-102703: Fix typo in modules tutorial documentation (GH-102707)
**Before**
This prevents directories with a common name, such as ``string``, unintentionally hiding ...
**After**
This prevents directories with a common name, such as ``string``, from unintentionally hiding ...
(cherry picked from commit 0a539b5db3)

Co-authored-by: Robert Prater (B. Eng) <robcprater@gmail.com>
2023-03-14 17:11:56 -07:00
Miss Islington (bot)
738dde303b
[3.11] gh-102354: change python3 to python in docs examples (GH-102696) (#102697)
gh-102354: change python3 to python in docs examples (GH-102696)
(cherry picked from commit 80abd62647)

Co-authored-by: Paul Watson <paul.hermeneutic@gmail.com>
2023-03-14 12:52:33 -06:00
Miss Islington (bot)
4392bf648f
docs: replace PyPI description with link (GH-101506)
(cherry picked from commit 45d014e03b)

Co-authored-by: François Magimel <magimel.francois@gmail.com>
2023-02-02 23:31:43 -08:00
Miss Islington (bot)
f80ba44f7d
gh-100633 Tutorial: Fix dataclasses import (GH-100638)
import dataclass not dataclasses from dataclasses
(cherry picked from commit 98308dbeb1)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2022-12-31 04:28:59 -08:00
Miss Islington (bot)
de621281ce
gh-55688: Add note about ending backslashes for raw strings (GH-94768)
(cherry picked from commit b95b1b3b25)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
2022-12-27 21:45:45 -08:00
Miss Islington (bot)
a7eee898ab
gh-99908: Tutorial: Modernize the 'data-record class' example (GH-100499)
(cherry picked from commit 00afa5066b)

Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-24 07:32:00 -08:00
Miss Islington (bot)
71b032635d
gh-70393: Clarify mention of "middle" scope (GH-98839)
(cherry picked from commit 70be5e42f6)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-11 20:25:06 -08:00
Miss Islington (bot)
e0fc2b3fd1
[doc] fix typo (GH-99143)
(cherry picked from commit 586b07e1f9)

Co-authored-by: Doj <34577424+visualdoj@users.noreply.github.com>
2022-11-05 14:12:22 -07:00
Miss Islington (bot)
129de5d4a2
Doc: use "unnumbered" footnotes (GH-98954)
Use unnumbered footnote in this file to avoid reseting the footnotes numbering.

Example: when building the tutorial into a PDF and using `latex_show_urls = "footnotes"`; this footnote become the number 8. However, without this change, the footnote shows the number 1.
(cherry picked from commit f042646595)

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
2022-11-01 06:35:34 -07:00
Miss Islington (bot)
e02ce485ac
[3.11] Missing PS1 prompt in tutorial example (GH-98921) (GH-98944)
(cherry picked from commit d22bde983e)


Co-authored-by: Manuel Kaufmann <humitos@gmail.com>

Automerge-Triggered-By: GH:rhettinger
2022-11-01 04:08:26 -07:00
Miss Islington (bot)
b2f037cce7
tutorial: remove "with single quotes" (GH-98204)
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>
2022-10-12 09:08:56 -07:00
Miss Islington (bot)
a2f728038e
doc: remove a misleading statement. (GH-98093)
(cherry picked from commit 571e23d991)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-10-10 01:50:26 -07:00
Miss Islington (bot)
3dc7bfee3e
[3.11] gh-97654: Add auto exception chaining example to tutorial (GH-97703) (#97885)
gh-97654: Add auto exception chaining example to tutorial (GH-97703)

Add auto exception chaining example to tutorial
(cherry picked from commit 395b66a0ae)

Co-authored-by: Shahriar Heidrich <smheidrich@weltenfunktion.de>
2022-10-05 14:50:46 -07:00
Miss Islington (bot)
1a620c579d
[3.11] Use SyntaxError invalid range in tutorial introduction example (GH-93031) (GH-97666)
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>
2022-09-30 10:12:22 +01:00
Miss Islington (bot)
4d1de87042
gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961)
(cherry picked from commit db39050396)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-09-25 01:20:45 -07:00
Miss Islington (bot)
ad49555d51
gh-81039: Add small example of f-string's "=}" to tutorial (gh-92291) (gh-96989)
(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>
2022-09-21 09:11:48 -04:00
Miss Islington (bot)
a1671a97d3
gh-95413: Remove references to deprecated CGI library (GH-95414)
(cherry picked from commit b17aae8bbd)

Co-authored-by: partev <petrosyan@gmail.com>
2022-08-30 04:22:19 -07:00
Miss Islington (bot)
fedd25eb64
small grammatical change (GH-96138) (GH-96157) 2022-08-21 15:55:00 -05:00
Miss Islington (bot)
a1a1fd0dee
Doc: Add omitted secondary prompt in inputoutput tutorial (GH-30317)
For the continuation lines, "..." should present as secondary prompt
(cherry picked from commit de28ee8f75)

Co-authored-by: Chenwei Xiao <chanvinxiao@163.com>
2022-07-23 02:33:17 -07:00
Miss Islington (bot)
3a33e9b7a0
Fix copy-friendliness of tutorial example (GH-93424)
(cherry picked from commit 34d11f1b0c)

Co-authored-by: Chenwei Xiao <chanvinxiao@163.com>
2022-07-22 13:21:41 -07:00
Miss Islington (bot)
77bf973930
Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) (GH-94557)
Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021
(cherry picked from commit 3440d197a5)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2022-07-05 14:30:19 +02:00
Miss Islington (bot)
cbd562ff4e
Docs: Update SyntaxError message in REPL example for list comprehension (GH-93901) (GH-94425)
(cherry picked from commit 22b783aba0)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2022-06-29 19:22:11 +02:00
Miss Islington (bot)
3937dbfaf8
gh-61585: Clarify import scope in modules tutorial (GH-93455) (GH-94373)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
(cherry picked from commit 4b854b7466)
2022-06-28 12:29:38 +02:00
Miss Islington (bot)
00a25f87f3
Closes gh-94152: Update pyvideo.org URL (GH-94075)
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>
2022-06-22 20:43:02 -07:00
Miss Islington (bot)
5bca4bba98
gh-94114: Remove obsolete reference to python.org mirrors (GH-94115)
* gh-94114
(cherry picked from commit 8661c5053f)

Co-authored-by: partev <petrosyan@gmail.com>
2022-06-22 10:05:04 -07:00
Miss Islington (bot)
736f545cd3
Tutorial: specify match cases don't fall through (GH-93615) (GH-94083)
(cherry picked from commit dd5cf84f24)

Co-authored-by: max <36980911+pr2502@users.noreply.github.com>
2022-06-21 21:52:47 +02:00
Łukasz Langa
c76e6f745c
[3.11] gh-93240: clarify wording in IO tutorial (GH-93276) (GH-94082)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit 51d673176a)

Co-authored-by: paulreece <96156234+paulreece@users.noreply.github.com>
2022-06-21 21:51:15 +02:00
Miss Islington (bot)
9a2fe42b11
gh-89158: Add some REPL secondary prompt markers (GH-93073)
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>
2022-05-22 22:18:09 -07:00
Miss Islington (bot)
b6da20fffa
gh-77521: Add link to builtin module names in modules tutorial (GH-92438)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 859250cc55)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-05-08 12:45:14 -07:00
gophra
a79001ee16
gh-92368: Fix missing possessive apostrophe (#92397)
* Fix missing possessive apostrophe
2022-05-06 15:39:16 +02:00
Inada Naoki
614420df97
gh-85679: Recommend encoding="utf-8" in tutorial (GH-91778) 2022-05-02 17:25:05 +09:00
slateny
efb87b1090
gh-85757: Change wording from nested to inner (GH-91811)
#85757

https://docs.python.org/3/tutorial/datastructures.html#nested-list-comprehensions

I do think this is clearer, but I wonder if 'nested' should be kept though to get the terminology out there more often. So perhaps it could be something like 'inner (nested) listcomp' or 'nested (inner) listcomp' despite sounding a bit redundant

Automerge-Triggered-By: GH:rhettinger
2022-04-30 15:12:33 -07:00
Irit Katriel
f92bcfe6de
gh-89770: [PEP-678] add exception notes to tutorial (GH-30441) 2022-04-20 13:43:10 +01:00
180909
efbc668183
gh-91541: Fix error in example in modules tutorial (#91634) 2022-04-17 14:17:04 -07:00
Irit Katriel
04f9658c59
gh-90449: Improve accuracy and readability of exceptions tutorial (GH-31899) 2022-04-13 21:45:33 +01:00
Ville Skyttä
dc14e33eff
bpo-22295: use python -m pip rather than plain pip in more examples (GH-24003) 2022-04-09 14:37:01 -04:00
Ken Jin
9ffe47df54
bpo-47189: What's New in 3.11: Faster CPython (GH-32235)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-04-06 19:38:25 +08:00
Bob Kline
6db2db91b9
Follow PEP-8 guidelines in tutorial for standard library (GH-26127) 2022-04-03 15:31:03 -07:00
Russel Webber
c62b944dfc
bpo-31582: Created a new documentation section describing sys.path initialization (GH-31082) 2022-03-23 17:29:40 +00:00
William Andrea
badb637c8c
docs: Don't use code formatting for emphasis (GH-30519) 2022-03-07 20:14:47 -08:00
William Andrea
35f55cc5c6
docs: Link match statement in tutorial (GH-31396)
Add a link to the `match` statement from its section in the tutorial.

This should be backported to 3.10.

[Initially submitted as #31395 but against the wrong branch. Thanks @Mariatta]

Automerge-Triggered-By: GH:Mariatta
2022-02-17 16:02:42 -08:00
Julien Palard
fa90e48c53
[doc] Enhance readability by avoiding big blocks for small numbers. (GH-31157)
Initially reported by Gregory Jacob on the docs@ mailing list:

https://mail.python.org/archives/list/docs@python.org/thread/VPSFGLOZOHSPF7TGPOI65AOH25TCPSVR/
2022-02-06 13:44:04 +01:00
Irit Katriel
c590b581bb
bpo-46328: Add sys.exception() (GH-30514) 2022-01-13 12:35:58 +00:00
Raymond Hettinger
d24cd49acb
bpo-46270: Describe the in and not in operators as membership tests. (GH-30504) 2022-01-09 18:02:06 -08:00
Irit Katriel
9925e70e48
bpo-45292: [PEP-654] exception groups and except* documentation (GH-30158) 2022-01-06 19:05:34 +00:00
Hugo van Kemenade
2db5613063
bpo-34538: Remove Exception subclassing from tutorial (GH-30361)
Remove the bit about subclassing exceptions.

Documentation PR can skip the NEWS label.

Automerge-Triggered-By: GH:iritkatriel
2022-01-03 14:52:09 -08:00
Raymond Hettinger
ac4eea2172
bpo-46079: Replace external link that is down for maintenance. (GH-30315) 2022-01-01 09:49:55 -08:00
Vivek Vashist
c5d18a5014
Fix the output of built-in iter() function example in Iterators (Section 9.8) of The Python Tutorial (GH-30110)
Updated the output for it=iter(s) from <iterator object at 0x00A1DB50> to <str_iterator object at 0x10c90e650>
2021-12-16 18:40:12 +08:00
Alex Waygood
1cbb88736c
bpo-46059: Clarify pattern-matching example in "control flow" docs (GH-30079)
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>
2021-12-14 23:04:29 +08:00