python / python/cpython

Add more examples in the `warnings` docs

Open
#93,343 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

This is a follow-up of GH-86438 and GH-23172. The warnings docs should include more examples to show how to match different types of warnings using both the provided functions and -W/PYTHONWARNINGS, especially since they behave differently.

At the bottom of https://github.com/pytest-dev/pytest/discussions/8759#discussioncomment-2818984 there are already some examples to illustrate some of the differences, even though some are specific to pytest.

Linked PRs
  • gh-106618

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the warnings documentation and review the examples at the linked pytest discussion, comparing the provided functions with -W and PYTHONWARNINGS. Done means the docs include examples for matching different warning types and clearly explain where these approaches behave differently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.