| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-126191)
gh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681)
* bpo-41411 fstring index in tutorial/inputoutput
To assist in searching for fstrings I have added an index
* Add newline
---------
(cherry picked from commit a3443c0e22a8623afe4c0518433b28afbc3a6df6)
Co-authored-by: amaajemyfren <32741226+amaajemyfren@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-122949) (#122954)
gh-122944: Fix incorrect prompt strings in the Python Tutorial (GH-122949)
In the REPL, top level comments are followed by a primary, not secondary prompt.
Fix the places in the in the tutorial that use the latter.
(cherry picked from commit be90648fb2de58b148dcc7553a08ca646911baf2)
Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
(GH-120219) (#120229)
(cherry picked from commit 225aab7f70d804174cc3a75bc04a5bb1545e5adb)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
|
| |
|
|
|
|
|
|
| |
GH-110383: Improve Tutorial for Input Ouput (GH-119230)
(cherry picked from commit 9db2fd7edaa9d03e8c649c3bb0e8d963233cde22)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
|
| |
|
|
|
| |
* Use full qualified names for references (even if they do not work now,
they will work in future).
* Silence references to examples.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use new-style index directive ('module') - C API
* Use new-style index directive ('module') - Library
* Use new-style index directive ('module') - Reference
* Use new-style index directive ('module') - Tutorial
* Uncomment module removal in pairindextypes
* Use new-style index directive ('module') - C API
* Use new-style index directive ('module') - Library
* Use new-style index directive ('module') - Reference
|
| | |
|
| | |
|
| |
|
| |
For the continuation lines, "..." should present as secondary prompt
|
| |
|
|
|
| |
(GH-94551)
Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021
|
| |
|
| |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
| | |
|
| | |
|
| |
|
| |
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
| |
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
In text mode, the "size" parameter indicates the number of characters, not bytes.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
A couple of fixes here to make this more PEP-8:
* Avoid multiple statements on one line with `;` statement separator -- this is very rare in Python and is "generally discouraged" in PEP 8 (and if used, per PEP 8 there shouldn't be a space before the `;`)
* Add output for the first "Formatted String Literals" example. (Side note: are the doctests for this being run? If so, why didn't it fail?)
* Avoid space before `!r`. I have generally not seen spaces before the `!`, and this also matches the style used in the docs here: https://docs.python.org/3/library/string.html#format-string-syntax
https://bugs.python.org/issue34712
|
| | |
|
| |
|
| |
The parentheses were incorrect.
|
| |
|
| |
The ValueError message ends with a period.
|
| |
|
|
|
|
|
|
| |
(#6036)
The 'output formatting' section of the tutorial talks a lot about manual formatting with things like .rjust() and .zfill(), with only a passing reference to 3.6's new f-strings.
This doesn't drop all of the old material, but it does rearrange the topics into a more modern order: f-strings first, discussing formatting specifiers a bit; then calling .format(); finally manual formatting with .ljust().
|
| |
|
| |
By default `print` adds spaces between its arguments.
|
| |
|
| |
Move up the discussion about 'with' keyword, so it appears earlier in the document.
|
| |
|
| |
import json before using json module
|
| |
|
|
|
|
| |
Replace
File "<stdin>", line 1, in ?
with
File "<stdin>", line 1, in <module>
|
| |\
| |
| |
| | |
Original patch by James Edwards.
|
| | |
| |
| |
| | |
Original patch by James Edwards.
|
| |\ \
| |/ |
|
| | | |
|
| |/
|
|
|
| |
Some of the inspiration and wording is taken from the text of PEP 498 by Eric
V. Smith, and the existing str.format() documentation.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
pickle module.
|
| |
|
|
| |
Patch by Sijin Joseph.
|
| | |
|
| |
|
|
| |
Patch by Dan Riti.
|
| | |
|
| | |
|
| |
|
|
| |
Thanks to Yongzhi Pan from docs@
|
| | |
|
| |\ |
|
| | | |
|
| |\ \
| |/ |
|