GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Clarify `warnings.deprecated` public API · Issue #150076 · python/cpython

Clarify warnings.deprecated public API #150076

New issue
Copy link
New issue
Copy link
Open
Open
Clarify warnings.deprecated public API#150076
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@flying-sheep
flying-sheep
opened on May 19, 2026
Issue body actions

Documentation

The current docs only specify that it sets the __deprecated__ attribute on the deprecated item.

Pydantic relies on its full API: the fact that it’s a class, and that its instances have all passed parameters in attributes: deprecated(**kw).__dict__ == kw basically.

Two questions:

  1. Is that safe or might deprecated get e.g. refactored into a function at some point?
  2. Can we subclass it and add parameters? Will type checkers understand this and still mark a @our_deprecated_subclass(...) def ... as deprecated? See How to extend warnings.deprecated? typing#2256

maybe related to #138165

Linked PRs

  • gh-150076: Fix the documented signature of warnings.deprecated #153879
  • [3.15] gh-150076: Fix the documented signature of warnings.deprecated (GH-153879) #154487
  • [3.14] gh-150076: Fix the documented signature of warnings.deprecated (GH-153879) #154488
  • [3.13] gh-150076: Fix the documented signature of warnings.deprecated (GH-153879) #154489

Activity

  1. flying-sheep
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on May 19, 2026
  2. github-project-automation
    added this to docs issueson May 19, 2026
  3. github-project-automation
    moved this to Todo in docs issueson May 19, 2026
  4. Viicos commented on May 19, 2026

    @Viicos
    Viicos
    on May 19, 2026
    Contributor
    More actions

    For context, this was discussed here during the implementation: #104004 (comment). It would maybe make sense to explicitly document it. For reference, typeshed already documents it as a class.

    Reacted by Philipp A.
  5. fedonman
    added 5 commits that reference this issue on Jul 18, 2026

    Merge branch 'main' into fix-pythongh-150076-warnings-deprecated-api

    7fccd37

    pythongh-150076: Don't document warnings.deprecated internals as publ…

    292000f

    Merge branch 'main' into fix-pythongh-150076-warnings-deprecated-api

    fea602e

    Merge branch 'main' into fix-pythongh-150076-warnings-deprecated-api

    a9dab0b

    Merge branch 'main' into fix-pythongh-150076-warnings-deprecated-api

    0dec5d7
  6. JelleZijlstra
    added 4 commits that reference this issue on Jul 22, 2026

    gh-150076: Fix the documented signature of warnings.deprecated (#153879)

    56ad3bc

    [3.13] gh-150076: Fix the documented signature of warnings.deprecated (…

    553e3b0

    [3.14] gh-150076: Fix the documented signature of warnings.deprecated (…

    12892a2

    [3.15] gh-150076: Fix the documented signature of warnings.deprecated (…

    b84c4cc
  7. StanFromIreland
    closed this as completedon Jul 25, 2026
  8. Viicos commented on Jul 26, 2026

    @Viicos
    Viicos
    on Jul 26, 2026
    Contributor
    More actions

    I don't think #153879 really fixes this issue.

  9. StanFromIreland
    reopened this on Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    Projects

    • docs issues
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.