Skip to content

Commit 5e5771d

Browse files
gh-140241: Fix documentation for the registry parameter of warnings.warn_explicit()
1 parent 7ac94fc commit 5e5771d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Doc/library/warnings.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,19 @@ Available Functions
480480
.. function:: warn_explicit(message, category, filename, lineno, module=None, registry=None, module_globals=None, source=None)
481481

482482
This is a low-level interface to the functionality of :func:`warn`, passing in
483-
explicitly the message, category, filename and line number, and optionally the
484-
module name and the registry (which should be the ``__warningregistry__``
485-
dictionary of the module). The module name defaults to the filename with
486-
``.py`` stripped; if no registry is passed, the warning is never suppressed.
483+
explicitly the message, category, filename and line number, and optionally
484+
other arguments.
487485
*message* must be a string and *category* a subclass of :exc:`Warning` or
488486
*message* may be a :exc:`Warning` instance, in which case *category* will be
489487
ignored.
490488

489+
*module*, if supplied, should be the module name.
490+
If no module is passed, the filename with ``.py`` stripped is used.
491+
492+
*registry*, if supplied, should be the ``__warningregistry__`` dictionary
493+
of the module.
494+
If no registry is passed, each warning is treated as the first occurrence.
495+
491496
*module_globals*, if supplied, should be the global namespace in use by the code
492497
for which the warning is issued. (This argument is used to support displaying
493498
source for modules found in zipfiles or other non-filesystem import

0 commit comments

Comments
 (0)