cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Add more examples in the `warnings` docs

Open ezio-melotti opened this issue 3 years ago • 8 comments

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

ezio-melotti avatar May 30 '22 01:05 ezio-melotti

Hi there, first time contributor here. I'd be happy to attempt this if that would be OK?

Jamesgo1 avatar Dec 23 '22 11:12 Jamesgo1

@Jamesgo1 Hi, that would be great, thanks!

See https://devguide.python.org for info about building docs and contributing PRs, and also feel free to ask here too.

hugovk avatar Dec 27 '22 17:12 hugovk

Hello, my name is Liam, and I’m part of a student software engineer group of 4 at Carnegie Mellon. We’ve been tasked with contributing to an open source project, and this issue seems like a great first start. Would you mind assigning this to me (my group)? Also, you might see the same comment on 1-2 other issues, since we’ll likely be working on more than just one for our assignment.

liam-gersten avatar Apr 17 '23 22:04 liam-gersten

Hi Liam and your group! Sounds great!

We don't usually assign issues, because sometimes people don't get around to making PRs for a wide variety of reasons, and we don't want others to think they've been pre-booked.

Instead, please go ahead with it, and don't hesitate to ask questions :)

hugovk avatar Apr 18 '23 02:04 hugovk

Hi @ezio-melotti ! I've made a PR with some new examples inspired from your link, can you take a look?

daniel-shimon avatar Jul 11 '23 08:07 daniel-shimon

@daniel-shimon is this issue still open to work on or you have created a PR so it's closed now? @hugovk

vaishnavi192 avatar Dec 22 '23 14:12 vaishnavi192

Hello! EuroPython 2024 - Sprints attendee here :) If this is still open, can I take it?

mirelagrigoras avatar Jul 14 '24 08:07 mirelagrigoras

@mirelagrigoras Hello! This issue already has a PR, although it's been open for a year. I'll give a ping on the PR, although I doubt we'll get an answer during today's sprint, so I suggest finding another issue. Thanks!

hugovk avatar Jul 14 '24 08:07 hugovk

Hi! I'd like to work on this. I see #106618 is linked—is that PR still active, or can I take a fresh approach?

If available, my plan is to:

Add 4–5 runnable code examples showing different warning filter patterns (using functions and -W/PYTHONWARNINGS)

Reference the pytest examples mentioned and adapt them for general use

Update Doc/library/warnings.rst with clear, tested examples

ETA: 2–3 days if this is still open. Thanks!

Yashp002 avatar Nov 15 '25 17:11 Yashp002

is that PR still active, or can I take a fresh approach

I don't think there is any new approach to take as the author addressed comments and we still need to review them. Also it was still active some months ago which is fine for a PR here IMO.

picnixz avatar Nov 15 '25 18:11 picnixz