cpython/Doc/tutorial
Miss Islington (bot) b9f932f9e2
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:39 -07:00
..
appendix.rst Improve highlighting of some code blocks. (GH-6401) 2018-04-09 07:56:44 -07:00
appetite.rst
classes.rst [3.7] bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174). (GH-11232) 2018-12-19 09:28:12 +02:00
controlflow.rst Doc: Fix: Proper UpperCamelCase and lowercase. (GH-14644) 2019-07-08 14:13:59 -07:00
datastructures.rst [3.7] bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174). (GH-11232) 2018-12-19 09:28:12 +02:00
errors.rst Improve clarity of try-return-finally-return (GH-15677) (GH-15982) 2019-09-11 19:42:09 +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:39 -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-14401) 2019-06-26 10:00:58 -07:00
introduction.rst bpo-36189: Fixing typo in tutorial introduction (GH-13093) 2019-05-04 23:22:34 -04:00
modules.rst closes bpo-35329: Change 'Package' to 'package' in accordance with PEP8. (GH-13008) 2019-04-29 19:26:00 -07:00
stdlib.rst bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (#15069) 2019-08-01 07:35:20 -07:00
stdlib2.rst Fixed mismatching title overline. 2016-12-04 15:43:57 +02:00
venv.rst bpo-33503: Fix the broken pypi link in the source and the documentation (GH-6814) (GH-6872) 2018-05-16 10:05:46 -04:00
whatnow.rst Add a footnote about Cheese Shop in Doc/tutorial (GH-13103) (GH-13174) 2019-05-07 21:59:20 +01:00