Serhiy Storchaka
db39050396
gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961)
2022-09-24 14:38:53 +03:00
Stanley
4b81139aac
gh-81039: Add small example of f-string's "=}" to tutorial (gh-92291)
2022-09-21 08:57:03 -04:00
Chenwei Xiao
de28ee8f75
Doc: Add omitted secondary prompt in inputoutput tutorial (GH-30317)
...
For the continuation lines, "..." should present as secondary prompt
2022-07-23 17:25:42 +08:00
Ned Batchelder
3440d197a5
Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551)
...
Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021
2022-07-05 11:16:10 +02:00
paulreece
51d673176a
gh-93240: clarify wording in IO tutorial (GH-93276)
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-06-21 21:40:11 +02:00
Inada Naoki
614420df97
gh-85679: Recommend `encoding="utf-8"` in tutorial (GH-91778)
2022-05-02 17:25:05 +09: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
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
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
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
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
Colin Watson
71ce03df9c
Clarify file-closing example in tutorial (GH-11652)
2019-04-17 08:18:37 -04:00
Serhiy Storchaka
2b57c43f21
bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)
2018-12-19 08:09:46 +02:00
Ben Hoyt
3705b98620
bpo-34712: Fix style in examples in "Input and Output" (GH-9361)
...
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
2018-09-19 03:28:28 -07:00
Julien Palard
25fa141487
Doc: Missing 'f' in an f-string. (GH-9074)
2018-09-07 11:31:47 +02:00
Aaqa Ishtyaq
cb5f3fdb9d
Remove extra parentheses in output formatting tutorial (GH-8350)
...
The parentheses were incorrect.
2018-07-20 09:06:44 -07:00
Lysandros Nikolaou
9cffdbffc3
Fix documentation for input and output tutorial (GH-8231)
...
The ValueError message ends with a period.
2018-07-10 17:11:34 -07:00
Andrew Kuchling
ced350b195
bpo-28626: rearrange discussion of output formatting to encourage f-strings ( #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().
2018-07-07 17:36:23 -04:00
Cheryl Sabella
84c4b0cc67
bpo-25059: Clarify the print separator usage in tutorial (GH-5879)
...
By default `print` adds spaces between its arguments.
2018-02-25 11:06:01 -08:00
Andrew Kuchling
bd4e9e0ca9
bpo-6519: Improve Python Input Output Tutorial (GH-2143)
...
Move up the discussion about 'with' keyword, so it appears earlier in the document.
2017-06-12 22:31:01 -07:00
suketa
1dbce04d0e
bpo-30621: Update Input Output Tutorial Example(GH-2074)
...
import json before using json module
2017-06-11 18:42:59 -07:00
UltimateCoder
8856940cf2
bpo-28315: Improve code examples in docs (GH-1372)
...
Replace
File "<stdin>", line 1, in ?
with
File "<stdin>", line 1, in <module>
2017-05-03 09:46:45 -07:00
Serhiy Storchaka
c499f30286
Issue #23921 : Standardized documentation whitespace formatting.
...
Original patch by James Edwards.
2016-05-10 12:01:56 +03:00
Serhiy Storchaka
dba903993a
Issue #23921 : Standardized documentation whitespace formatting.
...
Original patch by James Edwards.
2016-05-10 12:01:23 +03:00
Georg Brandl
2d43bc2fc2
merge with 3.5
2016-02-22 14:53:03 +01:00
Georg Brandl
f1d371bde9
Update example; str(float) changed so there is difference now.
2016-02-22 14:52:55 +01:00
Martin Panter
bc1ee460dc
Issue #25179 : Documentation for formatted string literals aka f-strings
...
Some of the inspiration and wording is taken from the text of PEP 498 by Eric
V. Smith, and the existing str.format() documentation.
2016-02-13 00:41:37 +00:00
Ezio Melotti
397bb2486a
#26001 : mention in the tutorial that files in binary mode expect bytes, not str.
2016-01-12 11:27:30 +02:00
Jason R. Coombs
842c07414e
Issue #24729 : Correct reference to open function.
2015-07-29 14:04:36 -04:00
Alessandro Cucci
d8de44b6b3
Issue #24729 : Update tutorial to match implementation.
2015-07-28 21:00:10 +02:00
Georg Brandl
6b4c847c4f
Doc: fix default role usage (except in unittest mock docs)
2014-10-30 22:26:26 +01:00
Antoine Pitrou
dd799d2e32
Issue #18840 : Introduce the json module in the tutorial, and deemphasize the pickle module.
2013-12-05 23:46:32 +01:00
R David Murray
1c4e443ea2
#16273 : Fix tutorial discussion of seek/tell (opaque text-mode values).
...
Patch by Sijin Joseph.
2013-07-30 15:51:57 -04:00
Raymond Hettinger
c1939b8f75
Issue #18031 : %-formatting isn't dead yet and might pull through.
2013-05-23 00:14:47 -07:00
Ezio Melotti
ed3cd7e445
#13510 : clarify that f.readlines() is note necessary to iterate over a file. Patch by Dan Riti.
2013-04-15 19:08:31 +03:00
Petri Lehtinen
9f74c6cf7d
Issue #8890 : Stop advertising an insecure use of /tmp in docs
2013-02-23 19:27:49 +01:00
Chris Jerdonek
5bf7f1f6e3
Clarify universal-newline wording in tutorial (issue #16266 ).
2012-10-17 20:17:41 -07:00
Andrew Svetlov
e9cf97cf20
Issue #16265 : Fix collapsing of code sample in tutorial.
...
Thanks to Yongzhi Pan from docs@
2012-10-17 16:41:28 +03:00
Sandro Tosi
a17ef14632
fix typo
2012-08-14 19:51:43 +02:00
Ezio Melotti
0def5c6907
Merge with 3.1.
2011-03-13 02:27:26 +02:00
Ezio Melotti
2b73660135
Fix markup in inputoutput.rst.
2011-03-13 02:19:57 +02:00
Georg Brandl
891391bf68
Merge doc fixes.
2011-03-06 11:12:42 +01:00
Georg Brandl
3640e18d90
#11405 : do not reference the string module again for its deprecated functions, only for Template class.
2011-03-06 10:56:18 +01:00
Raymond Hettinger
756fe2608d
Issue #11304 : Input/output tutorial - PI is rounded not truncated.
2011-02-24 00:06:16 +00:00
Georg Brandl
60203b41b0
Migrate to Sphinx 1.0 C language constructs.
2010-10-06 10:11:56 +00:00
Antoine Pitrou
25d535ea6a
Merged revisions 84827-84829 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84827 | antoine.pitrou | 2010-09-15 11:58:26 +0200 (mer., 15 sept. 2010) | 3 lines
Add a glossary entry for file objects.
........
r84828 | antoine.pitrou | 2010-09-15 12:08:31 +0200 (mer., 15 sept. 2010) | 3 lines
Update file-related information in the FAQ.
........
r84829 | antoine.pitrou | 2010-09-15 13:11:28 +0200 (mer., 15 sept. 2010) | 3 lines
Add cross-references to the glossary entry for file objects.
........
2010-09-15 11:25:11 +00:00
Antoine Pitrou
11cb961b38
Add cross-references to the glossary entry for file objects.
2010-09-15 11:11:28 +00:00
Georg Brandl
7baf625bab
Merged revisions 74613,74615,74619-74620,74622 via svnmerge from
...
svn+ssh://svn.python.org/python/branches/py3k
................
r74613 | georg.brandl | 2009-09-01 09:34:27 +0200 (Di, 01 Sep 2009) | 1 line
#6814 : remove traces of xrange().
................
r74615 | georg.brandl | 2009-09-01 09:42:40 +0200 (Di, 01 Sep 2009) | 9 lines
Recorded merge of revisions 74614 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74614 | georg.brandl | 2009-09-01 09:40:54 +0200 (Di, 01 Sep 2009) | 1 line
#6813 : better documentation for numberless string formats.
........
................
r74619 | georg.brandl | 2009-09-01 10:02:03 +0200 (Di, 01 Sep 2009) | 1 line
#6754 : remove old struct member nb_inplace_divide.
................
r74620 | georg.brandl | 2009-09-01 10:03:26 +0200 (Di, 01 Sep 2009) | 1 line
#6732 : fix return value of module init function in example.
................
r74622 | georg.brandl | 2009-09-01 10:11:14 +0200 (Di, 01 Sep 2009) | 73 lines
Merged revisions 74542,74544-74548,74550,74554-74555,74578,74588,74590,74603,74616-74618,74621 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74542 | georg.brandl | 2009-08-23 23:28:56 +0200 (So, 23 Aug 2009) | 1 line
Restore alphabetic order.
........
r74544 | georg.brandl | 2009-08-24 19:12:30 +0200 (Mo, 24 Aug 2009) | 1 line
#6775 : fix python.org URLs in README.
........
r74545 | georg.brandl | 2009-08-24 19:14:29 +0200 (Mo, 24 Aug 2009) | 1 line
#6772 : mention utf-8 as utf8 alias.
........
r74546 | georg.brandl | 2009-08-24 19:20:40 +0200 (Mo, 24 Aug 2009) | 1 line
#6725 : spell "namespace" consistently.
........
r74547 | georg.brandl | 2009-08-24 19:22:05 +0200 (Mo, 24 Aug 2009) | 1 line
#6718 : fix example.
........
r74548 | georg.brandl | 2009-08-24 19:24:27 +0200 (Mo, 24 Aug 2009) | 1 line
#6677 : mention "deleting" as an alias for removing files.
........
r74550 | georg.brandl | 2009-08-24 19:48:40 +0200 (Mo, 24 Aug 2009) | 1 line
#6677 : note that rmdir only removes empty directories.
........
r74554 | georg.brandl | 2009-08-27 20:59:02 +0200 (Do, 27 Aug 2009) | 1 line
Typo fix.
........
r74555 | georg.brandl | 2009-08-27 21:02:43 +0200 (Do, 27 Aug 2009) | 1 line
#6787 : reference fix.
........
r74578 | tarek.ziade | 2009-08-29 15:33:21 +0200 (Sa, 29 Aug 2009) | 1 line
fixed #6801 : symmetric_difference_update also accepts pipe
........
r74588 | georg.brandl | 2009-08-30 10:35:01 +0200 (So, 30 Aug 2009) | 1 line
#6803 : fix old name.
........
r74590 | georg.brandl | 2009-08-30 13:51:53 +0200 (So, 30 Aug 2009) | 1 line
#6801 : fix copy-paste oversight.
........
r74603 | georg.brandl | 2009-08-31 08:38:29 +0200 (Mo, 31 Aug 2009) | 1 line
other -> others where multiple arguments are accepted.
........
r74616 | georg.brandl | 2009-09-01 09:46:26 +0200 (Di, 01 Sep 2009) | 1 line
#6808 : clarification.
........
r74617 | georg.brandl | 2009-09-01 09:53:37 +0200 (Di, 01 Sep 2009) | 1 line
#6765 : hint that log(x, base) is not very sophisticated.
........
r74618 | georg.brandl | 2009-09-01 10:00:47 +0200 (Di, 01 Sep 2009) | 1 line
#6810 : add a link to the section about frame objects instead of just a description where to find it.
........
r74621 | georg.brandl | 2009-09-01 10:06:03 +0200 (Di, 01 Sep 2009) | 1 line
#6638 : fix wrong parameter name and markup a class.
........
................
2009-09-01 08:13:16 +00:00
Georg Brandl
2f3ed6808e
Recorded merge of revisions 74614 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74614 | georg.brandl | 2009-09-01 09:40:54 +0200 (Di, 01 Sep 2009) | 1 line
#6813 : better documentation for numberless string formats.
........
2009-09-01 07:42:40 +00:00
Georg Brandl
01a30523f9
Merged revisions 74264 via svnmerge from
...
svn+ssh://svn.python.org/python/branches/py3k
................
r74264 | alexandre.vassalotti | 2009-07-29 22:12:15 +0200 (Mi, 29 Jul 2009) | 32 lines
Merged revisions 74075,74187,74197,74201,74216,74225 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74075 | georg.brandl | 2009-07-18 05:06:31 -0400 (Sat, 18 Jul 2009) | 1 line
#6505 : fix typos.
........
r74187 | benjamin.peterson | 2009-07-23 10:19:08 -0400 (Thu, 23 Jul 2009) | 1 line
use bools for autoraise
........
r74197 | benjamin.peterson | 2009-07-24 22:03:48 -0400 (Fri, 24 Jul 2009) | 1 line
clarify
........
r74201 | amaury.forgeotdarc | 2009-07-25 12:22:06 -0400 (Sat, 25 Jul 2009) | 2 lines
Better name a variable: 'buf' seems to imply a mutable buffer.
........
r74216 | michael.foord | 2009-07-26 17:12:14 -0400 (Sun, 26 Jul 2009) | 1 line
Issue 6581. Michael Foord
........
r74225 | kurt.kaiser | 2009-07-27 12:09:28 -0400 (Mon, 27 Jul 2009) | 5 lines
1. Clean workspace more thoughly before build.
2. Add url of branch we are building to 'results' webpage.
(url is now available in $repo_path, could be added to failure email.)
3. Adjust permissions to improve upload reliability.
........
................
2009-08-13 08:37:59 +00:00