<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Doc/tutorial/inputoutput.rst, branch v3.8.5</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>Improve IO tutorial's "Old string formatting" section (GH-16251)</title>
<updated>2020-05-28T01:41:31+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2020-05-28T01:41:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c0c5db54cf9243ee3d6bd4c0306c6ba39db186c3'/>
<id>c0c5db54cf9243ee3d6bd4c0306c6ba39db186c3</id>
<content type='text'>
* 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 &lt;aeros167@gmail.com&gt;
(cherry picked from commit eaca2aa117d663acf8160a0b4543ee2c7006fcc7)

Co-authored-by: Adorilson Bezerra &lt;adorilson@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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 &lt;aeros167@gmail.com&gt;
(cherry picked from commit eaca2aa117d663acf8160a0b4543ee2c7006fcc7)

Co-authored-by: Adorilson Bezerra &lt;adorilson@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-37635: Update arg name for seek() in IO tutorial (GH-16147)</title>
<updated>2019-09-14T20:47:31+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-09-14T20:47:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=4a71df88cdba77c409ee70146dd6445b19267df4'/>
<id>4a71df88cdba77c409ee70146dd6445b19267df4</id>
<content type='text'>
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.htmlGH-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
(cherry picked from commit ff603f6c3d3dc0e9ea8c1c51ce907c4821f42c54)

Co-authored-by: Kyle Stanley &lt;aeros167@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.htmlGH-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
(cherry picked from commit ff603f6c3d3dc0e9ea8c1c51ce907c4821f42c54)

Co-authored-by: Kyle Stanley &lt;aeros167@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Correct info about "f.read(size)". (GH13852)</title>
<updated>2019-09-10T16:00:09+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-09-10T16:00:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=6c588a00ed88dc621023771d5c50167423d0eea3'/>
<id>6c588a00ed88dc621023771d5c50167423d0eea3</id>
<content type='text'>
In text mode, the "size" parameter indicates the number of characters, not bytes.
(cherry picked from commit faff81c05f838b0b7a64bbc8c53c02a9b04bb79d)

Co-authored-by: William Andrea &lt;william.j.andrea@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In text mode, the "size" parameter indicates the number of characters, not bytes.
(cherry picked from commit faff81c05f838b0b7a64bbc8c53c02a9b04bb79d)

Co-authored-by: William Andrea &lt;william.j.andrea@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Clarify file-closing example in tutorial (GH-11652)</title>
<updated>2019-04-17T12:18:37+00:00</updated>
<author>
<name>Colin Watson</name>
<email>cjwatson@ubuntu.com</email>
</author>
<published>2019-04-17T12:18:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=71ce03df9c643faa94fbdf73bbb4e99a9a62cbdc'/>
<id>71ce03df9c643faa94fbdf73bbb4e99a9a62cbdc</id>
<content type='text'>


</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>


</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)</title>
<updated>2018-12-19T06:09:46+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2018-12-19T06:09:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=2b57c43f21f891df4c6f2294a3b9e1b9029a16b6'/>
<id>2b57c43f21f891df4c6f2294a3b9e1b9029a16b6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-34712: Fix style in examples in "Input and Output" (GH-9361)</title>
<updated>2018-09-19T10:28:28+00:00</updated>
<author>
<name>Ben Hoyt</name>
<email>benhoyt@gmail.com</email>
</author>
<published>2018-09-19T10:28:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=3705b9862025705ea60041a9e310f99a164db722'/>
<id>3705b9862025705ea60041a9e310f99a164db722</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>Doc: Missing 'f' in an f-string. (GH-9074)</title>
<updated>2018-09-07T09:31:47+00:00</updated>
<author>
<name>Julien Palard</name>
<email>julien@palard.fr</email>
</author>
<published>2018-09-07T09:31:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=25fa141487e61b94f15289619cb3af764cf65e58'/>
<id>25fa141487e61b94f15289619cb3af764cf65e58</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove extra parentheses in output formatting tutorial (GH-8350)</title>
<updated>2018-07-20T16:06:44+00:00</updated>
<author>
<name>Aaqa Ishtyaq</name>
<email>aaqaishtyaq@gmail.com</email>
</author>
<published>2018-07-20T16:06:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=cb5f3fdb9d353a572dd22fb50a110e52d5bb81b1'/>
<id>cb5f3fdb9d353a572dd22fb50a110e52d5bb81b1</id>
<content type='text'>
The parentheses were incorrect.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The parentheses were incorrect.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix documentation for input and output tutorial (GH-8231)</title>
<updated>2018-07-11T00:11:34+00:00</updated>
<author>
<name>Lysandros Nikolaou</name>
<email>lisandrosnik@gmail.com</email>
</author>
<published>2018-07-11T00:11:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=9cffdbffc3b2dec18def1c3e8cfa166d01d609df'/>
<id>9cffdbffc3b2dec18def1c3e8cfa166d01d609df</id>
<content type='text'>
The ValueError message ends with a period.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ValueError message ends with a period.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-28626: rearrange discussion of output formatting to encourage f-strings (#6036)</title>
<updated>2018-07-07T21:36:23+00:00</updated>
<author>
<name>Andrew Kuchling</name>
<email>amk@amk.ca</email>
</author>
<published>2018-07-07T21:36:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=ced350b1952857a9b9c68ec7e2786358bcb61050'/>
<id>ced350b1952857a9b9c68ec7e2786358bcb61050</id>
<content type='text'>
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().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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().
</pre>
</div>
</content>
</entry>
</feed>
