cpython/Doc/tutorial
Miss Islington (bot) 4a71df88cd
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.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 ff603f6c3d)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-09-14 13:47:31 -07:00
..
appendix.rst Improve highlighting of some code blocks. (GH-6401) 2018-04-08 19:18:04 +03:00
appetite.rst Merged revisions 66452 via svnmerge from 2008-09-13 17:46:05 +00:00
classes.rst bpo-12634: Clarify an awkward section of the tutorial (GH-15406) (GH-15409) 2019-08-22 23:45:57 -07:00
controlflow.rst bpo-30826: Improve control flow examples (GH-15407) (GH-15410) 2019-08-22 23:52:12 -07:00
datastructures.rst bpo-14050: Note that not all data can be sorted (GH-15381) (GH-15395) 2019-08-22 09:39:52 -07:00
errors.rst Improve clarity of try-return-finally-return (GH-15677) (GH-15981) 2019-09-11 19:42:21 +02:00
floatingpoint.rst Issue #27206: Fix doctests in Doc/tutorial. 2016-08-09 17:44:52 -05:00
index.rst #23891: add a section to the Tutorial describing virtual environments and pip 2015-06-08 17:35:45 -04:00
inputoutput.rst bpo-37635: Update arg name for seek() in IO tutorial (GH-16147) 2019-09-14 13:47:31 -07:00
interactive.rst bpo-25910: Fixes redirection from http to https (#4674) 2017-12-06 17:39:33 +01:00
interpreter.rst Improve Windows commands in tutorial (GH-14400) 2019-06-26 09:41:45 -07:00
introduction.rst bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465) (GH-15469) 2019-08-24 11:33:18 -07:00
modules.rst closes bpo-35329: Change 'Package' to 'package' in accordance with PEP8. (GH-13008) 2019-04-29 19:20:06 -07:00
stdlib.rst bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (#15070) 2019-08-01 07:34:57 -07:00
stdlib2.rst Start of 3.8.0a0 2018-01-31 17:44:09 -05:00
venv.rst bpo-37403: Touch up venv docs (GH-14458) 2019-06-28 12:36:09 -07:00
whatnow.rst Add a footnote about Cheese Shop in Doc/tutorial (GH-13103) 2019-05-07 16:20:58 -04:00