710 Commits

Author SHA1 Message Date
Shantanu
161fc18edc
[3.11] gh-104479: Update outdated tutorial floating-point reference (GH-104681) (#104961)
(cherry picked from commit 2cf04e455d8f087bd08cd1d43751007b5e41b3c5)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2023-05-26 06:30:03 +00:00
Miss Islington (bot)
4b11af058e
[3.11] GH-97950: Use new-style index directive ('builtin') (GH-104164) (#104221)
GH-97950: Use new-style index directive ('builtin') (GH-104164)

* Uncomment builtin removal in pairindextypes

* Use new-style index directive ('builtin') - C API

* Use new-style index directive ('builtin') - Extending

* Use new-style index directive ('builtin') - Library

* Use new-style index directive ('builtin') - Reference

* Use new-style index directive ('builtin') - Tutorial
(cherry picked from commit f5088006ca8e9654fbc3de119462f0ab764e408b)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-06 07:14:37 +03:00
Miss Islington (bot)
6a970ae666
[3.11] GH-97950: Use new-style index directive ('statement') (GH-104162) (#104163)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-04 13:57:14 +03:00
Miss Islington (bot)
c463796ba7
[3.11] GH-97950: Use new-style index directive ('object') (GH-104158) (#104159)
GH-97950: Use new-style index directive ('object') (GH-104158)

* Uncomment object removal in pairindextypes

* Use new-style index directive ('object') - C API

* Use new-style index directive ('object') - Library

* Use new-style index directive ('object') - Reference

* Use new-style index directive ('object') - Tutorial
(cherry picked from commit 6ab463684b9d79880d98cd1f1406aa86af65985e)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-04 13:14:16 +03:00
Adam Turner
00563694bb
[3.11] GH-97950: Use new-style index directive ('module') (GH-103996) (#104154) 2023-05-04 11:39:15 +03:00
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 8709697292c67254ba836d7e88d1eba08c4a351a)

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 0a539b5db312d126ff45dd4aa6a53d40a292c512)

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 80abd62647b2a36947a11a6a8e395061be6f0c61)

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 45d014e03ba7ba4c9c912120ec36b2aca02061f4)

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 98308dbeb110198ebe28bdb7720d3671b3e7f57b)

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 b95b1b3b25b0a93a22c7d58ac5bd5870e62070a8)

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 00afa5066bd45348ed82a38d3442763b2ed1a068)

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 70be5e42f6e288de32e0df3c77ac22a9ddf1a74b)

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 586b07e1f9f15825e6564df031744fe812b28655)

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 f042646595d1cdd2ecdc15222b1766f746d010f0)

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 d22bde983e58eaff9773f32a8324ddf9074e95e1)


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 5f8ca1b7969f34ee09adb7b28337ebd920e6215a)

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 571e23d99157ed7ad67ca2334a396fc9ddbe07ec)

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 395b66a0ae5237eec195ca97daaaf8563706ed34)

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 db39050396a104c73d0da473a2f00a62f9dfdfaa)

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 4b81139aac3fa11779f6eedb6e621bde29e64b30)

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 b17aae8bbd13bec28b7ecbb5a147503f2e9cf365)

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 de28ee8f755760fda13b481a34b1f326984d293a)

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 34d11f1b0c0e1936a37581e0fb0daec637afca47)

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 3440d197a55800ecceea3e115e44b4262411359c)

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 22b783aba05bcc3a21af9e5ae308ffbb98ff6a12)

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 4b854b746650214eddadb2440efd9e1544d08ccb)
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 7c439dca13435085efb2fddf9ac75e5305db7ada)

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 8661c5053fbe3e246289d77e49a813470b3a16f7)

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 dd5cf84f245abf84405833320b8f25dbc43b24d2)

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 51d673176ac90f2144e3e7a492e5b3ea53bdba2e)

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 88f0d0c1e8fdda036f3f64b0048911ba28ce7f06)

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 859250cc55711f4d62b65922d3f7537826c3801e)

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