classification
Title: Doc: fix keyword `as` link from `import` and `try`
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: cheryl.sabella, docs@python, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-12-15 01:38 by cheryl.sabella, last changed 2018-12-19 07:28 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11173 closed cheryl.sabella, 2018-12-15 01:42
PR 11174 merged serhiy.storchaka, 2018-12-15 11:45
PR 11232 merged serhiy.storchaka, 2018-12-19 06:14
Messages (4)
msg331883 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-12-15 01:38
In the documentation, using the :keyword:`as` role links to the `as` defined for the `with` statement, which could be confusing when it was used in the `import` or `try` section of the docs.

https://docs.python.org/3/reference/simple_stmts.html#the-import-statement
msg331899 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-15 12:04
I think links from "as" are not needed. They are just refer to the beginning of the same section. In all occurrences of "as" the corresponding "with", "import", or "try"/"except" keywords are mentioned too, and links from them refer to the correct section. I think it is better to remove links from "as" at all.

There are same issues with the "else" keyword which is used in the "if", "while", "for" and "try" statements and in the "if" expression. There are same issues with the "if" and "for" keyword in the context of comprehensions, with the "if" keyword in the context of the "if" expression, and with the "in" keyword in the context of "for".

The proposed PR removes redundant and incorrect links from keywords. It removes also redundant links if the same keyword is mentioned several times in the single paragraph (in same cases there were up to 5 links to the same target). It fixes also some other minor bugs.
msg332110 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-19 06:09
New changeset 2b57c43f21f891df4c6f2294a3b9e1b9029a16b6 by Serhiy Storchaka in branch 'master':
bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)
https://github.com/python/cpython/commit/2b57c43f21f891df4c6f2294a3b9e1b9029a16b6
msg332112 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-19 07:28
New changeset 1e47fbcf78c4d66fbe1fc7b4ea91a6b147ff83d2 by Serhiy Storchaka in branch '3.7':
[3.7] bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174). (GH-11232)
https://github.com/python/cpython/commit/1e47fbcf78c4d66fbe1fc7b4ea91a6b147ff83d2
History
Date User Action Args
2018-12-19 07:28:48serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.7
2018-12-19 07:28:16serhiy.storchakasetmessages: + msg332112
2018-12-19 06:14:45serhiy.storchakasetpull_requests: + pull_request10466
2018-12-19 06:09:48serhiy.storchakasetmessages: + msg332110
2018-12-15 12:04:07serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg331899
2018-12-15 11:45:43serhiy.storchakasetpull_requests: + pull_request10415
2018-12-15 01:42:30cheryl.sabellasetkeywords: + patch
stage: patch review
pull_requests: + pull_request10413
2018-12-15 01:38:24cheryl.sabellacreate