FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-140241: Fix documentation for the registry parameter of warnings.warn_explicit() (GH-140242) by miss-islington · Pull Request #140292 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
15 changes: 11 additions & 4 deletions Doc/library/warnings.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,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
Expand Down
Loading

Back | FazBrowse Home | New Git URL