Commit Graph

679 Commits

Author SHA1 Message Date
Nicolas Haller 88f0d0c1e8
gh-89158: Add some REPL secondary prompt markers (#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.
2022-05-23 00:58:07 -04:00
yashlad681 3115c2c036
gh-91249: Remove .bat extension in documentation for when activating venv on Windows. (GH-92770) 2022-05-13 15:36:05 +01:00
slateny 859250cc55
gh-77521: Add link to builtin module names in modules tutorial (#92438)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-08 12:30:38 -07:00
Pablo Galindo e851177536
Python 3.12.0a0 2022-05-08 03:40:52 +01: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
Zachary Ware 9f2f7e4226
bpo-45916: Use HTTPS link for The Perils of Floating Point (GH-29896) 2021-12-02 14:24:25 -06:00
180909 7484a5c82a
Closes bpo-45712: Add missing word in control flow tutorial (GH-29460) 2021-11-08 10:51:01 -06:00
Thomas 5a14f71fe8
bpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105) 2021-10-21 12:19:20 +02:00
srinivasan 11b2ae7f5b
bpo-45442: Add deactivate step to venv tutorial. (GH-28981)
@vsajip Sorry for the trouble—made a [fairly significant] git error in the previous PR.

Have edited the patch as you had said in #28959.

Automerge-Triggered-By: GH:vsajip
2021-10-15 14:24:25 -07:00
Peter Bittner 55b45bf707
bpo-38623: Add note about site module (site-packages) (GH-16974) 2021-09-23 23:39:58 +02:00
Serhiy Storchaka 36122e1814
bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515)
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>
2021-09-22 20:33:36 +03:00
Jack DeVries 7cba23164c
bpo-39452: Rewrite and expand __main__.rst (#26883)
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>
2021-08-24 19:01:41 +02:00
Raymond Hettinger 15a64d89a3
bpo-44966: Fix out-of-date traceback message (GH-27867) 2021-08-21 13:59:18 -05:00
Jefferson Oliveira 599f5c8481
introduce omitted index default before using it (GH-27775) 2021-08-17 23:19:03 +02:00
meowmeowmeowcat ed524b4569
bpo-44907: Update error messages in tutorial examples (GH-27755) 2021-08-13 19:40:58 -04:00
Thomas Grainger e9a6f1b78b
bpo-41576: document BaseException in favor of bare except (GH-21917) 2021-08-06 22:44:15 +02:00
Mariusz Felisiak 11749e2dc2
bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-27 00:11:55 +02:00
jdevries3133 2f49c9debc
bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919) 2021-06-27 20:27:20 +01:00
Terry Jan Reedy 2f47d8dcc7
bpo-43927: Change 'IOError' to 'OSError' (GH-26289)
This is the last remaining instance, at least for this chapter, in 3.10 & 3.11.
2021-05-21 13:54:01 -04:00
Zackery Spytz 4fdcc39f71
bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) 2021-05-18 14:56:01 -07:00
Erlend Egeberg Aasland 07797121cc
bpo-43729: Clarify comment in tutorial example (GH-25191) 2021-05-14 12:09:08 -07:00
Irit Katriel 6574334a68
bpo-40640: doc -- add missing ... in example of Continue (#26055)
Co-authored-by: Chas Belov <59780179+ChasBelov@users.noreply.github.com>
2021-05-12 11:23:03 +01:00
Roberto Hueso a0b9915a8b
bpo-32822: Add finally with return/break/continue to the tutorial (#25600)
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.
2021-05-04 14:36:01 +02:00
Pablo Galindo bb3e0c240b
Python 3.11.0a0 2021-05-03 21:25:35 +01:00
sblondon 2fd928c8c1
bpo-42589: Change URL for 'from' link when used in a raised exception (GH-23872)
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.
2021-04-29 11:02:40 -07:00
Bob Kline 133705b85c
bpo-43777: Drop description of "pip search" command from tutorial (GH-25287) 2021-04-14 14:09:32 +09:00
Raymond Hettinger f8775e4f72
bpo-43325: Add FAQ entry for identity tests (GH-25168) 2021-04-03 19:54:49 -07:00
Irit Katriel a53e9a7cf5
bpo-39231: correct tutorial annotations section (GH-25029) 2021-03-27 13:20:58 -04:00
cmhzc 8d00462850
bpo-43319: Fixed the tutorial on venv about standard library (GH-24740)
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
2021-03-07 01:08:50 -08:00
Daniel F Moisset a22bca6b1e
bpo-42128: Add documentation for pattern matching (PEP 634) (#24664)
This is a first edition, ready to go out with the implementation. We'll iterate during the rest of the period leading up to 3.10.0.

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandt@python.org>
Co-authored-by: Raymond Hettinger <1623689+rhettinger@users.noreply.github.com>
Co-authored-by: Guido van Rossum <guido@python.org>
2021-02-28 20:08:38 -08:00
Terry Jan Reedy b30fcba3a8
bpo-43042: Augment tutorial sentence (GH-24514)
Calling same function also gets new local namespace.
2021-02-19 19:26:21 -05:00