Skip to content

Commit

Permalink
gh-125761: Clarify repeated warning suppression criteria in warnings …
Browse files Browse the repository at this point in the history
…module (gh-126326)
  • Loading branch information
byungchanKo99 authored Nov 2, 2024
1 parent cfb1b2f commit 10eeec2
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 @@ -180,6 +180,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 10eeec2

Please sign in to comment.