gh-129846: clarify suppression of warning output in catch_warnings#130768
gh-129846: clarify suppression of warning output in catch_warnings#130768Mr-Sunglasses wants to merge 11 commits into
catch_warnings#130768Conversation
…t in `catch_warnings`
catch_warnings
catch_warningscatch_warnings
StanFromIreland
left a comment
There was a problem hiding this comment.
I think we should drop the note and just integrate it above.
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
tagging @sobolevn for a review. TiA. |
|
This PR is stale because it has been open for 30 days with no activity. |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
While we are here, I suggest few more changes.
- Replace
:const:`False`and:const:`True`with simplefalseandtrue. Any value is accepted, not only these singletons. - Replace
:class:`None`with``None``. It is not a class. - Start the new sentence from the new line. We change this line in any case, this will minimize changed lines in future.
- Mention that
:func:`showwarning`is reset to the default implementation. - Maybe the sentence can be changed more, it looks complicated like "The House That Jack Built".
|
@StanFromIreland, could you please review the current variant? |
Documentation build overview
|
catch_warningscatch_warnings
catch_warningscatch_warnings
|
Note: we don't use conventional commits headings |
| false, the context manager works by replacing and then later restoring the | ||
| module's :func:`showwarning` function. That is not concurrent-safe. | ||
|
|
||
| When *record* is true and the flag is true, the :func:`showwarning` function |
There was a problem hiding this comment.
Hmm, should this be fixed too:
Lines 712 to 720 in 56bd9ea
There was a problem hiding this comment.
The code does not match the documentation. This can be a separate bug.
There was a problem hiding this comment.
This was changed in #146358, but now not only the code does not match docs, but I am not sure that context_aware_warnings have not lost its meaning.
Co-authored-by: Stan Ulbrych <stan@python.org>
Issue: #129846