[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation
New submission from Mariatta <mariatta@python.org>: We received a documentation bug report in docs mailing list. https://mail.python.org/archives/list/docs@python.org/thread/BLANNZUPUEOJ4LJ... It looks like the doc currently says that, typing.NoReturn was added in both 3.5.4 and 3.6.2 It appeared from this change, that it was originally added in 3.6.5 (https://github.com/python/cpython/pull/7107/files) However, during a refactoring effort, in https://github.com/python/cpython/commit/ab72fdeb82c3ab045b480cd4bb4f928c126..., the 3.5.4 and 3.6.2 info were added, perhaps due to copy-pasting. I think it should be changed into .. versionadded:: 3.6.5 However, I'm curious to know whether there are other parts in the doc, where this info is wrong. So perhaps there was other parts of the doc that was added in 3.5.4, but somehow we moved that to the typing.NoReturn section. For now, I think we can just fix it by adding .. versionadded: 3.6.5 And maybe someone else can look into other parts of the doc to see if the version info are correct. ---------- assignee: docs@python components: Documentation keywords: easy, newcomer friendly messages: 392341 nosy: Mariatta, docs@python priority: normal severity: normal stage: needs patch status: open title: Incorrect "versionadded" info in typing.NoReturn documentation versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43978> _______________________________________
Change by Rahul Kumaresan <kayrahul@gmail.com>: ---------- nosy: +rahul-kumi _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43978> _______________________________________
Rahul Kumaresan <kayrahul@gmail.com> added the comment: Although the documentation for 'typing.NoReturn' is made in: https://github.com/python/cpython/pull/7107/files The actual inclusion of the 'typing.NoReturn' was made through the following this PR: https://github.com/python/typing/pull/397 Also the change is registered in the changelog under Python 3.6.2 rc1 release as: ''' bpo-28556: Various updates to typing module: add typing.NoReturn type, use WrapperDescriptorType, minor bug-fixes. Original PRs by Jim Fasarakis-Hilliard and Ivan Levkivskyi. ''' So shouldn't the correct version here should be 3.6.2? ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43978> _______________________________________
Change by Miguel Brito <miguel.mdebrito@gmail.com>: ---------- keywords: +patch nosy: +miguendes nosy_count: 3.0 -> 4.0 pull_requests: +24450 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25760 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43978> _______________________________________
Miguel Brito <miguel.mdebrito@gmail.com> added the comment: This looks like a leftover from a merge conflict. Or a bad copy and paste indeed. I've checked the file prior to the PR and the was no version 3.5.4 tag. I've opened a PR to fix this: https://github.com/python/cpython/pull/25760 ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43978> _______________________________________
Ken Jin <kenjin4096@gmail.com> added the comment: Hi Miguel, with reference to https://github.com/python/cpython/pull/25760#issuecomment-830338306, Guido rejected the PR because he said that the current docs are correct. This is a major point of confusion for many people, but here's why a single feature can be added in 2 versions: PEP 484 (Type Hints) was initially accepted as 'Provisional' (you can see what this means in PEP 1). To spare you the details, it's a special pass for typing.py to add new features in point releases, and to backport new features to older versions - even if they aren't bugfixes! This goes against what most of CPython allows (new features usually aren't allowed to be backported). However, at the time, typing.py was pretty new, so there wasn't much existing code to break anyways. Another example is asyncio. Which has since lost its provisional status a long time ago AFAIK. typing.py became de-facto non-provisional in 3.7, though PEP 484 hasn't been updated yet. This is why you may see stuff overlapping between 3.5 and 3.6. I hope you learnt something cool :). Hope to see you around contributing to other parts of CPython! ---------- nosy: +kj resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43978> _______________________________________
Rahul Kumaresan <kayrahul@gmail.com> added the comment: Hello Ken Jin, Thanks for this clarification! ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43978> _______________________________________
Ken Jin <kenjin4096@gmail.com> added the comment: To answer the person who posted this on docs mailing list, after much investigation, it seems that this made it into 3.7.0, 3.5.4 and 3.6.2 . Here's the 3.7.0 (alpha) commit for the initial implementation of typing.NoReturn: https://github.com/python/cpython/commit/f06e0218ef6007667f5d61184b85a81a046... The backport to 3.6 (at the time, this was 3.6.2rc1): https://github.com/python/cpython/commit/e612c28513b406779d187e5f816445c7d40... The backport to 3.5 (at the time, this was 3.5.4rc1): https://github.com/python/cpython/commit/4b15e45895ca56ac5f7837cacb8cd3ccc26... I'm sorry if I got anything wrong (this is somewhat confusing for me too). ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43978> _______________________________________
participants (4)
-
Ken Jin
-
Mariatta
-
Miguel Brito
-
Rahul Kumaresan