Commit graph

664 commits

Author SHA1 Message Date
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
Adorilson Bezerra 89294e30ff
Doc: errors tutorial improvements (GH-16269)
Improvements:

- Improvements in how try clause works section
  This suggestion is because the execution continues after *except*, not after *try* but before *except*. I guess this form more clear.

- Surrounding some keywords with \*...\*
  For uniformity the highlighted terms  

- Adjust the number of chars per line to 80
2021-01-30 22:07:11 -08:00
Vladimir 3f9fe23c05
bpo-42179: Clarify exception chaining (GH-23160)
* Update errors.rst

Clarify exception chaining behaviour and give a reference to the library documentation.

* Update errors.rst

Wording

* Update errors.rst

Spelling

* Update errors.rst

Remove mentioning of special attributes as folks think it's too much for beginners.
2020-12-15 18:47:26 -08:00
Zackery Spytz d41ec65ab7
bpo-42489: Fix the signature for list.sort() in the tutorial (GH-23538) 2020-11-28 16:53:39 +02:00
Volker-Weissmann c8aaf71dde
bpo-17852: Doc: Fix the tutorial about closing files (GH-23135)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-11-27 09:41:32 +09:00
Inada Naoki bde33e428d
bpo-42179: Doc/tutorial: Remove mention of __cause__ (GH-23162) 2020-11-06 11:45:01 +09:00
Andre Delfino c8bb24166e
[doc] Update references to NumPy (GH-22458)
Numeric(al) Python to NumPy. It seems the old name hasn't been used for some time.
2020-10-01 16:22:14 -07:00
Andre Delfino e8a2076e14
Revert "Fix all Python Cookbook links (#22205)" (GH-22424)
This commit reverts commit ac0333e1e1 as the original links are working again and they provide extended features such as comments and alternative versions.
2020-09-27 01:47:25 +01:00
Andre Delfino ac0333e1e1
Fix all Python Cookbook links (#22205) 2020-09-15 21:13:26 +01:00
Neeraj Samtani 7bcc6456ad
bpo-41776: Revise example of "continue" in the tutorial documentation (GH-22234)
Revise example of "continue" in the tutorial documentation
2020-09-15 09:39:29 -04:00
Denis Ovsienko 0be7c216e1
Fix grammar in Doc/tutorial/controlflow.rst (GH-21885)
Automerge-Triggered-By: @csabella
2020-08-19 04:29:47 -07:00
Victor Stinner bb0b08540c
bpo-40204: Fix reference to terms in the doc (GH-21865)
Sphinx 3 requires to refer to terms with the exact case.

For example, fix the Sphinx 3 warning:

Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case
sensitive match.made a reference to loader instead.
2020-08-14 12:20:05 +02:00
Paul McMillan 4f28f75dee
Fix repeated words in Classes tutorial (GH-21455)
The phrase "At any time during execution," was repeated twice.

Automerge-Triggered-By: @Mariatta
2020-07-13 18:26:23 -07:00
Joannah Nanjekye d12af71047
bpo-28681: Clarify multiple function names in the tutorial (GH-21340)
* improve control flow docs

* Add also

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-07-05 22:47:15 -03:00
Joannah Nanjekye 9ed3cd8ba0
bpo-26205: Specify the number of nested scopes (GH-21324)
* Clarify number of scopes

* Indicate 3 or 4

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-07-05 22:42:24 -03:00
Adorilson Bezerra eaca2aa117
Improve IO tutorial's "Old string formatting" section (GH-16251)
* Use a more universal explanation of string interpolation rather than specifically referencing sprintf(), which depends on the reader having a C background.


Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-05-27 21:34:01 -04:00