Skip to content

Commit

Permalink
[3.12] gh-125761: Clarify repeated warning suppression criteria in wa…
Browse files Browse the repository at this point in the history
…rnings module (gh-126331)

(cherry picked from commit 10eeec2)

Co-authored-by: 고병찬 <[email protected]>
  • Loading branch information
miss-islington and byungchanKo99 authored Nov 2, 2024
1 parent eecea8f commit f4bc64d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Doc/library/warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,19 @@ If a warning is reported and doesn't match any registered filter then the
"default" action is applied (hence its name).



.. _repeated-warning-suppression-criteria:

Repeated Warning Suppression Criteria
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The filters that suppress repeated warnings apply the following criteria to determine if a warning is considered a repeat:

- ``"default"``: A warning is considered a repeat only if the (*message*, *category*, *module*, *lineno*) are all the same.
- ``"module"``: A warning is considered a repeat if the (*message*, *category*, *module*) are the same, ignoring the line number.
- ``"once"``: A warning is considered a repeat if the (*message*, *category*) are the same, ignoring the module and line number.


.. _describing-warning-filters:

Describing Warning Filters
Expand Down

0 comments on commit f4bc64d

Please sign in to comment.