New submission from Webb Scales <wscales(a)redhat.com>:
In Section 8.6 ("Function definitions"; https://docs.python.org/3/reference/compound_stmts.html#function-definitions), the definition of "parameter_list" looks slightly wrong:
parameter_list ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]] | parameter_list_no_posonly
The "/" (and the comma preceding it) is not a required component. (Sorry, I'm afraid I'm not smart enough right now to suggest a correction. :-p )
----------
assignee: docs@python
components: Documentation
messages: 392943
nosy: docs@python, webbnh
priority: normal
severity: normal
status: open
title: In documentation Section 8.6, the definition of parameter_list need correcting
versions: Python 3.9
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue44038>
_______________________________________
New submission from Terry J. Reedy <tjreedy(a)udel.edu>:
In #44010, we are trying, as best as is possible with comprehensible REs, to identify in which circumstances occurrences of 'match', 'case' and '_' are keywords, and should be marked as such. I was initially unsure and even wrong about '_'.
1. Capture Patterns: I was confused by 'And is instead...'. 'It is instead ...', where 'it' refers to '_', is clearer to me.
2. Wildcard Patterns: "'_' is a soft keyword" just says it sometimes is and sometimes is not, but not when, or rather, where. After experiments like this (using the new IDLE 'copy with prompts' option ;-):
>>> _ = 'a'
>>> match [_, 'b']:
... case [capture, _] if _ == 'a':
... print(capture, _)
...
a a
I added (in PR to come, with markup that might be improved)
"within any pattern, but only within patterns. It is an identifier, as usual, even within ``match`` headers, ``guards``, and ``case blocks``.
Please consider also adding an example like the above.
----------
assignee: docs@python
components: Documentation
messages: 392848
nosy: brandtbucher, docs@python, gvanrossum, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Match doc: Clarify '_' as a soft keyword
type: behavior
versions: Python 3.10, Python 3.11
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue44025>
_______________________________________
New submission from Mariatta <mariatta(a)python.org>:
We received a documentation bug report in docs mailing list.
https://mail.python.org/archives/list/docs@python.org/thread/BLANNZUPUEOJ4L…
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/ab72fdeb82c3ab045b480cd4bb4f928c12…, 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(a)bugs.python.org>
<https://bugs.python.org/issue43978>
_______________________________________
New submission from Karl Kornel <karl(a)kornel.us>:
Hello!
In https://github.com/python/cpython/blob/master/Lib/typing.py#L115-L117, there is a note about the io and re classes not being included in typing.__all__. I am a relatively new user of typing, and I did `from typing import *` in my code. I ran the code through mypy first, which reported no problems, but then running Python 3.6 failed with a NameError (name 'IO' is not defined).
Reading through the typing source, it's clear that this was an intentional decision. So, instead of reporting a bug, I'd like to request a documentation enhancement!
The docs for typing make no mention of typing.io or typing.re. So, my request is: In the sections for the IO/TextIO/BinaryIO and Pattern/Match classes, include text warning the user that these types are not imported when you do `from typing import *`.
----------
assignee: docs@python
components: Documentation
messages: 353763
nosy: Karl Kornel, docs@python
priority: normal
severity: normal
status: open
title: In typing docs, note explicit import needed for IO and Pattern/Match
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue38352>
_______________________________________
Łukasz Langa <lukasz(a)langa.pl> added the comment:
New changeset 8655521de8760e8a695bcce92937800c079ea2b2 by Miss Islington (bot) in branch '3.10':
bpo-32822: Add finally with return/break/continue to the tutorial (GH-25600) (#25893)
https://github.com/python/cpython/commit/8655521de8760e8a695bcce92937800c07…
----------
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue32822>
_______________________________________
Łukasz Langa <lukasz(a)langa.pl> added the comment:
New changeset 91cb1e20e6a432b8b2c1b5db37b03c84b15384fa by Miss Islington (bot) in branch '3.9':
bpo-32822: Add finally with return/break/continue to the tutorial (GH-25600) (#25890)
https://github.com/python/cpython/commit/91cb1e20e6a432b8b2c1b5db37b03c84b1…
----------
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue32822>
_______________________________________
Łukasz Langa <lukasz(a)langa.pl> added the comment:
3.8 is in security fixes mode but I'll happily take this for 3.9.
----------
nosy: +lukasz.langa
versions: -Python 3.8
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue32822>
_______________________________________