https://github.com/python/cpython/commit/762fbdbf8c01c8c23e352eb256264628beaceed8
commit: 762fbdbf8c01c8c23e352eb256264628beaceed8
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2025-10-18T11:03:03Z
summary:

[3.13] gh-140241: Fix documentation for the registry parameter of 
warnings.warn_explicit() (GH-140242) (GH-140293)

(cherry picked from commit 78e1d65a4d656e783bc28a02e113f59e4323e41a)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>

files:
M Doc/library/warnings.rst

diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
index 71ce83c3f2ef3e..18c4f8977a87e0 100644
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -469,14 +469,21 @@ Available Functions
 .. function:: warn_explicit(message, category, filename, lineno, module=None, 
registry=None, module_globals=None, source=None)
 
    This is a low-level interface to the functionality of :func:`warn`, passing 
in
-   explicitly the message, category, filename and line number, and optionally 
the
-   module name and the registry (which should be the ``__warningregistry__``
-   dictionary of the module).  The module name defaults to the filename with
-   ``.py`` stripped; if no registry is passed, the warning is never suppressed.
+   explicitly the message, category, filename and line number, and optionally
+   other arguments.
    *message* must be a string and *category* a subclass of :exc:`Warning` or
    *message* may be a :exc:`Warning` instance, in which case *category* will be
    ignored.
 
+   *module*, if supplied, should be the module name.
+   If no module is passed, the filename with ``.py`` stripped is used.
+
+   *registry*, if supplied, should be the ``__warningregistry__`` dictionary
+   of the module.
+   If no registry is passed, each warning is treated as the first occurrence,
+   that is, filter actions ``"default"``, ``"module"`` and ``"once"`` are
+   handled as ``"always"``.
+
    *module_globals*, if supplied, should be the global namespace in use by the 
code
    for which the warning is issued.  (This argument is used to support 
displaying
    source for modules found in zipfiles or other non-filesystem import

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to