diff options
author | 고병찬 <70642609+byungchanKo99@users.noreply.github.com> | 2024-11-02 11:37:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-02 11:37:26 (GMT) |
commit | 10eeec2d4ffb6b09a6d925877b6d9ef6aa6bb59d (patch) | |
tree | d78ea79b61e56e2f88413c1de9ad1b0f052c94ac /Doc | |
parent | cfb1b2f0cb999558a30e61a9e1a62fdb7f55f6a4 (diff) | |
download | cpython-10eeec2d4ffb6b09a6d925877b6d9ef6aa6bb59d.zip cpython-10eeec2d4ffb6b09a6d925877b6d9ef6aa6bb59d.tar.gz cpython-10eeec2d4ffb6b09a6d925877b6d9ef6aa6bb59d.tar.bz2 |
gh-125761: Clarify repeated warning suppression criteria in warnings module (gh-126326)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/warnings.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index 1e7c4c8..0c7e854 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -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 |