Commit graph

640 commits

Author SHA1 Message Date
Miss Islington (bot)
bfa4237ecf
bpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105) (GH-29120)
(cherry picked from commit 5a14f71fe8)

Co-authored-by: Thomas <thmsdnnr@gmail.com>
2021-10-21 14:42:10 +02:00
Miss Islington (bot)
d747f5e805
[doc] Update references to NumPy (GH-22458) (GH-28749)
Numeric(al) Python to NumPy. It seems the old name hasn't been used for some time.
(cherry picked from commit c8bb24166e)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2021-10-06 15:04:48 +02:00
Miss Islington (bot)
d672dd34f0
bpo-38623: Add note about site module (site-packages) (GH-16974) (GH-28537)
(cherry picked from commit 55b45bf707)

Co-authored-by: Peter Bittner <django@bittner.it>
2021-09-24 00:48:26 +02:00
Miss Islington (bot)
f1d5cdef57
bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515) (GH-28524)
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>
2021-09-23 13:25:57 +03:00
Miss Islington (bot)
407b3e0bb0
bpo-44966: Fix out-of-date traceback message (GH-27867) (GH-27876) 2021-08-21 19:36:54 -05:00
Miss Islington (bot)
1bc05419b8
introduce omitted index default before using it (GH-27775) (GH-27803)
(cherry picked from commit 599f5c8481)

Co-authored-by: Jefferson Oliveira <jefferson.dev.insights@gmail.com>
2021-08-17 23:49:53 +02:00
Miss Islington (bot)
43bab0537c
bpo-44907: Update error messages in tutorial examples (GH-27755)
(cherry picked from commit ed524b4569)

Co-authored-by: meowmeowmeowcat <meowmeowcat1211@gmail.com>
2021-08-13 20:25:38 -04:00
Miss Islington (bot)
1acd1e6385
bpo-40620: Clarify tutorial controlflow.rst `range` examples (GH-26919) (GH-26928)
(cherry picked from commit 2f49c9debc)

Co-authored-by: jdevries3133 <58614260+jdevries3133@users.noreply.github.com>
2021-06-27 20:52:32 +01:00
Miss Islington (bot)
e10bd76d47
bpo-43927: Change 'IOError' to 'OSError' (GH-26289)
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>
2021-05-21 11:17:10 -07:00
Miss Islington (bot)
74eb94af2b
bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) (GH-26219)
(cherry picked from commit 4fdcc39f71)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2021-05-19 09:59:36 +01:00
Miss Islington (bot)
c90642b0d4
bpo-43729: Clarify comment in tutorial example (GH-25191) (GH-26137)
(cherry picked from commit 07797121cc)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-14 13:06:34 -07:00
Miss Islington (bot)
ada9cdb941
bpo-40640: doc -- add missing ... in example of Continue (GH-26055) (GH-26058)
Co-authored-by: Chas Belov <59780179+ChasBelov@users.noreply.github.com>
(cherry picked from commit 6574334a68)
2021-05-12 11:28:10 +01:00
Miss Islington (bot)
91cb1e20e6
bpo-32822: Add finally with return/break/continue to the tutorial (GH-25600) (#25890)
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>
2021-05-04 15:17:21 +02:00
Miss Islington (bot)
3eaa6f9d18
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.
(cherry picked from commit 2fd928c8c1)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
2021-04-29 11:26:26 -07:00
Miss Islington (bot)
57873af35a
bpo-43777: Drop description of "pip search" command from tutorial (GH-25287)
(cherry picked from commit 133705b85c)

Co-authored-by: Bob Kline <bkline@users.noreply.github.com>
2021-04-13 22:34:39 -07:00
Miss Islington (bot)
de0b2b1330
bpo-43325: Add FAQ entry for identity tests (GH-25168) (GH-25178) 2021-04-03 20:05:50 -07:00
Miss Islington (bot)
7990072999
bpo-39231: correct tutorial annotations section (GH-25029)
(cherry picked from commit a53e9a7cf5)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2021-03-27 10:43:08 -07:00
Miss Islington (bot)
a67fd011ea
bpo-43042: Augment tutorial sentence (GH-24514)
Calling same function also gets new local namespace.
(cherry picked from commit b30fcba3a8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-02-19 16:46:57 -08:00
Miss Islington (bot)
4a44f53aa8
[3.9] bpo-17852: Doc: Fix the tutorial about closing files (GH-23135) (GH-23527)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
(cherry picked from commit c8aaf71dde)


Co-authored-by: Volker-Weissmann <39418860+Volker-Weissmann@users.noreply.github.com>
2020-12-01 02:53:42 -08:00
Miss Islington (bot)
cc5eb935c7
bpo-42489: Fix the signature for list.sort() in the tutorial (GH-23538)
(cherry picked from commit d41ec65ab7)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-11-28 07:14:23 -08:00
Miss Islington (bot)
e74fb2d766
bpo-42179: Doc/tutorial: Remove mention of __cause__ (GH-23162)
(cherry picked from commit bde33e428d)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-11-05 19:05:57 -08:00
Miss Islington (bot)
0cc037f8a7
bpo-41776: Revise example of "continue" in the tutorial documentation (GH-22234) (GH-22255)
Revise example of "continue" in the tutorial documentation
(cherry picked from commit 7bcc6456ad)

Co-authored-by: Neeraj Samtani <neerajjsamtani@gmail.com>

Co-authored-by: Neeraj Samtani <neerajjsamtani@gmail.com>
2020-09-15 09:56:28 -04:00
Miss Islington (bot)
72d5ddb930
Fix grammar in Doc/tutorial/controlflow.rst (GH-21885) (#21922)
Automerge-Triggered-By: @csabella
(cherry picked from commit 0be7c216e1)

Co-authored-by: Denis Ovsienko <denis@ovsienko.info>
2020-08-22 05:08:02 -04:00
Victor Stinner
8f88190af5
[3.9] bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) (GH-21901)
* bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844)

Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the
c_warn_on_allowed_pre_v3 option to make the documentation compatible
with Sphinx 2 and Sphinx 3.

(cherry picked from commit 423e77d6de)

* bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858)

Use generic '.. object::' to declare markers, rather than abusing
'..  c:function::' which fails on Sphinx 3.

(cherry picked from commit 43577c01a2)

* bpo-40204: Fix duplicates in the documentation (GH-21857)

Fix two Sphinx 3 issues:

Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'.
Declaration is 'PyBUF_ND'.

Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'.
Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'.

(cherry picked from commit 46d10b1237)

* bpo-40204: Add :noindex: in the documentation (GH-21859)

Add :noindex: to duplicated documentation to fix "duplicate object
description" errors.

For example, fix this Sphinx 3 issue:

Doc/library/configparser.rst:1146: WARNING: duplicate object
description of configparser.ConfigParser.optionxform, other instance
in library/configparser, use :noindex: for one of them

(cherry picked from commit d3ded08048)

* bpo-40204, doc: Fix syntax of C variables (GH-21846)

For example, fix the following Sphinx 3 errors:

Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters
Invalid C declaration: Expected identifier in nested name. [error at 5]
  void \*obj
  -----^

Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*'
Invalid C declaration: Expected end of definition. [error at 8]
  PyObject*
  --------^

The modified documentation is compatible with Sphinx 2 and Sphinx 3.

(cherry picked from commit 474652fe93)

* 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.

(cherry picked from commit bb0b08540c)

* bpo-40204: Fix duplicated productionlist names in the doc (GH-21900)

Sphinx 3 disallows having more than one productionlist markup with
the same name. Simply remove names in this case, since names are not
shown anyway. For example, fix the Sphinx 3 warning:

Doc/reference/introduction.rst:96: duplicate token description
of *:name, other instance in reference/expressions

(cherry picked from commit 1abeda80f7)
2020-08-19 19:25:22 +02:00
Miss Islington (bot)
805874a9f1
Fix repeated words in Classes tutorial (GH-21455)
The phrase "At any time during execution," was repeated twice.

Automerge-Triggered-By: @Mariatta
(cherry picked from commit 4f28f75dee)

Co-authored-by: Paul McMillan <paul@mcmillan.ws>
2020-07-13 18:49:56 -07:00
Miss Islington (bot)
00c09f06a4
bpo-28681: Clarify multiple function names in the tutorial (GH-21340) (GH-21343)
* improve control flow docs

* Add also

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

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit d12af71047)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-07-05 23:07:32 -03:00
Miss Islington (bot)
3f4a9fd912
bpo-26205: Specify the number of nested scopes (GH-21324) (GH-21341)
* 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>
(cherry picked from commit 9ed3cd8ba0)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-07-05 23:06:16 -03:00
Miss Islington (bot)
d23ee5d652
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>
(cherry picked from commit eaca2aa117)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2020-05-27 18:41:38 -07:00
Rahul Kumaresan
eefd4e0333
bpo-39705 : sorted() tutorial example under looping techniques improved (GH-18999) 2020-05-17 18:32:34 -07:00
Noah Doersing
8bcfd31cc0
Change 'exception happened' to 'exception occurred' in two places (#19767) 2020-04-30 21:30:10 -07:00
Antoine
e5e56328af
bpo-39869: Fix typo in 'Instance objects' section. (GH-18889) 2020-03-10 07:17:40 -07:00
Don Kirkby
3ed4d25158
Grammar fix in tutorial (GH-18425) 2020-02-09 19:57:46 -05:00
Julien Palard
446463f8db
bpo-39534: Doc: Clarify return in finally (GH-18324) 2020-02-06 23:16:48 +01:00
Adorilson Bezerra
5807efd4c3
bpo-38558: Link to further docs from walrus operator mention in tutorial (GH-16973) 2020-02-03 18:11:19 +01:00
Shanavas M
7142df5ea2 bpo-39431: Also mention nonlocal in assignment quirk (GH-17375) 2020-01-23 13:09:21 -05:00
Raymond Hettinger
04c79d6088
bpo-38678: Improve argparse example in tutorial (GH-17207) 2019-11-17 22:06:19 -08:00
Jules Lasne (jlasne)
5e01a6542a Update interpreter.rst (GH-17059)
Fixed what seemed to be a weird phrasing.
2019-11-05 14:20:38 +01:00
Ammar Askar
cb2cf06b0a bpo-38558: Mention := in conditions tutorial (GH-16919) 2019-10-25 17:20:05 -05:00
Mohammad Dehghan
1ad7be2f16 bpo-38130: Fix error in explaining when an exception is re-raised (GH-16016)
Co-Authored-By: Ashwin Ramaswami <aramaswamis@gmail.com>
2019-09-26 11:09:05 +02:00
Jason Plurad
9ab6038fe8 Doc: Corrected syntax for return annotation (GH-16265)
Signed-off-by: Jason Plurad <pluradj@us.ibm.com>
2019-09-19 07:24:29 +02:00
Diego Alberto Barriga Martínez
b57481318e bpo-37904: Edition on python tutorial - section 4 (GH-16169)
A little change on first paragraph of python tutorial to be more clearly



https://bugs.python.org/issue37904



Automerge-Triggered-By: @ericvsmith
2019-09-17 09:57:55 -07:00
Adorilson Bezerra
f18242be16 Doc: Add link of GNU Readline library to interpreter tutorial (GH-16152) 2019-09-16 18:18:04 +02:00
Adorilson Bezerra
b7af4e7565 Doc: remove duplicate word in controlflow tutorial (GH-16163) 2019-09-16 09:04:58 +02:00
Kyle Stanley
ff603f6c3d bpo-37635: Update arg name for seek() in IO tutorial (GH-16147)
Typically, the second positional argument for ``seek()`` is *whence*. That is the POSIX standard name (http://man7.org/linux/man-pages/man3/lseek.3p.html) and the name listed in the documentation for ``io`` module (https://docs.python.org/3/library/io.html#io.IOBase.seek). 

The tutorial for IO is the only location where the second positional argument for ``seek()`` is referred to as *from_what*. I suspect this was created at an early point in Python's history, and was never updated (as this section predates the GitHub repository):

```
$ git grep "from_what"
Doc/tutorial/inputoutput.rst:To change the file object's position, use ``f.seek(offset, from_what)``.  The position is computed
Doc/tutorial/inputoutput.rst:the *from_what* argument.  A *from_what* value of 0 measures from the beginning
Doc/tutorial/inputoutput.rst:the reference point.  *from_what* can be omitted and defaults to 0, using the
```

For consistency, I am suggesting that the tutorial be updated to use the same argument name as the IO documentation and POSIX standard for ``seek()``, particularly since this is the only location where *from_what* is being used.

Note: In the POSIX standard, *whence* is technically the third positional argument, but the first argument *fildes* (file descriptor) is implicit in Python.


https://bugs.python.org/issue37635
2019-09-14 13:29:23 -07:00
toonarmycaptain
0cc27417f2 Improve clarity of try-return-finally-return (GH-15677)
Clarify execution in try-return-finally-return case.
2019-09-11 17:37:13 +02:00
William Andrea
faff81c05f Correct info about "f.read(size)". (GH13852)
In text mode, the "size" parameter indicates the number of characters, not bytes.
2019-09-10 15:50:26 +01:00
Raymond Hettinger
69ee87e99c
bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465) 2019-08-24 11:15:44 -07:00
Raymond Hettinger
6fcb6cfb13
bpo-30826: Improve control flow examples (GH-15407) 2019-08-22 23:44:19 -07:00
Raymond Hettinger
483ae0cf1d
bpo-12634: Clarify an awkward section of the tutorial (GH-15406) 2019-08-22 23:27:04 -07:00
Raymond Hettinger
4109263a7e
bpo-14050: Note that not all data can be sorted (GH-15381) 2019-08-22 09:11:35 -07:00