_warnings
| Use Case | Command | Description |
|---|---|---|
| Issue a warning (default category) | warn("message") | Issues a warning with default category and stacklevel |
| Issue a warning with specific category | warn("message", DeprecationWarning) | Issues a warning of a specific category |
| Issue a warning with increased stack level | warn("message", stacklevel=2) | Issues a warning with increased stack level |
| Low-level warning interface | warn_explicit(...) | Low-level interface to warnings functionality |
_warnings provides basic warning filtering support. It is a helper module to speed up interpreter start-up.
warn(message, category=None, stacklevel=1, source=None)Issue a warning, or maybe ignore it or raise an exception.
warn_explicit(...)Low-level interface to warnings functionality.
filters = [('default', None, <class 'DeprecationWarning'>, '__main__',...
(built-in)
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-02 19:12 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)