[issue37635] Using constant for whence arg in seek()

2019-09-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > What do you think of the followup PR to make use of the SEEK_* constants > listed in the documentation? I think it would be useful to at least mention > them in the tutorial, or even make use of them directly in the examples. Yes, I think it would be good

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread Kyle Stanley
Kyle Stanley added the comment: > Thanks you Kyle! No problem, thanks for merging it Antoine! What do you think of the followup PR to make use of the SEEK_* constants listed in the documentation? I think it would be useful to at least mention them in the tutorial, or even make use of them

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks you Kyle! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 ___ Python tracker

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread miss-islington
miss-islington added the comment: New changeset 4a71df88cdba77c409ee70146dd6445b19267df4 by Miss Islington (bot) in branch '3.8': bpo-37635: Update arg name for seek() in IO tutorial (GH-16147) https://github.com/python/cpython/commit/4a71df88cdba77c409ee70146dd6445b19267df4 --

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread miss-islington
miss-islington added the comment: New changeset b9f932f9e2a170a8d39b3c17f5fabb0967839d85 by Miss Islington (bot) in branch '3.7': bpo-37635: Update arg name for seek() in IO tutorial (GH-16147) https://github.com/python/cpython/commit/b9f932f9e2a170a8d39b3c17f5fabb0967839d85 --

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +15761 pull_request: https://github.com/python/cpython/pull/16150 ___ Python tracker ___

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +15762 pull_request: https://github.com/python/cpython/pull/16151 ___ Python tracker ___

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread miss-islington
miss-islington added the comment: New changeset ff603f6c3d3dc0e9ea8c1c51ce907c4821f42c54 by Miss Islington (bot) (Kyle Stanley) in branch 'master': bpo-37635: Update arg name for seek() in IO tutorial (GH-16147)

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread Kyle Stanley
Kyle Stanley added the comment: Created GH-16147 for replacing the *from_what* argument with *whence* in the IO tutorial. I would like to consider following up on this with another PR that adds the IO constants `SEEK_SET`, `SEEK_CUR`, and `SEEK_END` to the tutorial. Those constants would

[issue37635] Using constant for whence arg in seek()

2019-09-14 Thread Kyle Stanley
Change by Kyle Stanley : -- keywords: +patch pull_requests: +15757 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16147 ___ Python tracker ___

[issue37635] Using constant for whence arg in seek()

2019-07-26 Thread Kyle Stanley
Kyle Stanley added the comment: > I don't know. "whence" is the official name of the argument in the POSIX API > Perhaps "from_what" is assumed to be more understandable by the average > reader? >From looking at the blame on GitHub, it looks like the use of the "from_what" >argument in the

[issue37635] Using constant for whence arg in seek()

2019-07-26 Thread Kyle Stanley
Kyle Stanley added the comment: Clarification: By "latest commit" should be "oldest commit" with regards to the oldest commit in GitHub's history of the section of the "inputouput" tutorial that used the *from_what* argument for seek(). -- ___

[issue37635] Using constant for whence arg in seek()

2019-07-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't know. "whence" is the official name of the argument in the POSIX API: https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html Perhaps "from_what" is assumed to be more understandable by the average reader? Also, os.lseek() uses "how":

[issue37635] Using constant for whence arg in seek()

2019-07-26 Thread Kyle Stanley
Kyle Stanley added the comment: Upon further consideration, I think that it would be best to leave the code examples as is in the "inputoutput" tutorial, but it still be worth mentioning that the constants exist as alternatives. This is due to adding the additional step of "import io" in

[issue37635] Using constant for whence arg in seek()

2019-07-22 Thread Kyle Stanley
Kyle Stanley added the comment: > I would agree with changing the tutorial. The rest doesn't need to be > changed. Fair enough, that's understandable. I'll look into creating a PR for the tutorial to attach to this issue. Thanks for the feedback Antoine and Raymond. >AFAIK there is an

[issue37635] Using constant for whence arg in seek()

2019-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AFAIK there is an open PR which sweeps through the standard library, changing seek() everywhere to use named constants. -- nosy: +serhiy.storchaka ___ Python tracker

[issue37635] Using constant for whence arg in seek()

2019-07-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would agree with changing the tutorial. The rest doesn't need to be changed. -- ___ Python tracker ___

[issue37635] Using constant for whence arg in seek()

2019-07-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is Antoine's call. I believe he made the original decision not to sweep through the standard library, changing it everywhere it occurred. Perhaps this was performance reasons, perhaps the existing code was already clear enough, perhaps the

[issue37635] Using constant for whence arg in seek()

2019-07-20 Thread Kyle Stanley
Kyle Stanley added the comment: >The named versions are just alternatives available for end-users While it is true that the usage of 0,1,2 is more commonly used across the repository, the constants are used several times across Lib/_compression.py and Lib/_pyio.py. From my perspective, it

[issue37635] Using constant for whence arg in seek()

2019-07-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think it's okay to leave these as 0, 1, 2 because they have a long and well known tradition across multiple languages. The named versions are just alternatives available for end-users. The numbered forms also let us avoid a bunch of otherwise

[issue37635] Using constant for whence arg in seek()

2019-07-19 Thread Kyle Stanley
Change by Kyle Stanley : -- assignee: -> docs@python components: +Documentation, Tests nosy: +docs@python ___ Python tracker ___

[issue37635] Using constant for whence arg in seek()

2019-07-19 Thread Kyle Stanley
New submission from Kyle Stanley : In Python 3.1, three constants were added to the IO module to be used for the whence argument of seek(): SEEK_SET or 0 – start of the stream SEEK_CUR or 1 – current stream position SEEK_END or 2 – end of the stream However, there are at least 102