python / python/cpython

Replace deprecation lists in whatsnew files with tables

Ouverte
#122,652 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

docs
Langage dominant
Python
Étoiles
77.2k
Forks
35.9k
Métriques de merge des PR
Métriques de PR en attente

Description

Documentation

The whatsnew files currently contain lists of removals, deprecations, and pending removals (see e.g. https://docs.python.org/3.13/whatsnew/3.13.html#new-deprecations). These tables are not particularly easy to navigate and take enough space (~1/3?) that they make the whatsnew itself difficult to navigate too.

I would consider replacing them with one or more tables.

The columns could include:

  1. the deprecated/removed API (which links to the API itself using :func:/:class:/:meth:/etc.)
  2. the version where the deprecation was introduced
  3. the version where the API is/will be removed (not needed if we have a separate table for each version)
  4. a link to the PR that introduced the deprecation
  5. possibly the contributor

The table won't contain the full description that explains why it was deprecated and how to replace it, making the table more compact and easier to navigate than the list we currently have. This will also saves us from (near) duplicating the description in both the .. deprecated:: directive in the modules pages and in the whatsnew.

Most deprecated APIs are seldomly used and don't affect many users. If they do, they are probably just a small fraction of all the deprecations, so all the text in the list is not particularly useful. It's also easier to run the code and see the deprecation warnings/errors or quickly scan a table than scanning a long list of deprecations.

The table is still convenient for checking if anything I'm using has been deprecated, for ctrl+f'ing deprecated APIs as I'm fixing them, for finding links to the APIs, and for reviewing the versions where they will be removed.

Some notes about using tables:

  • Some deprecation require short description (e.g. "Passing more than one positional argument to sqlite3.connect()"). There are possible solutions to this:
    • don't elaborate further and just link to the API that contains the deprecation notice
    • have a column for the "affect API" and a "note" column where to add a short description (if needed)
    • only use the tables for deprecated APIs, leaving the rest as a list
  • The name/link to the API already contains the module name, but a separate column for the module might be easier to read
  • If we have different tables depending on the version the APIs is being removed, then we won't need a column for it.
  • Like the lists, the tables can be included in multiple whatsnew files using include files (see #122085)

(cc @hugovk, @AA-Turner, @encukou)

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par examiner les listes de deprecation, removal et pending-removal dans les fichiers whatsnew, y compris la page 3.13, et inspectez l’approche include-file référencée dans #122085. Le travail est considéré comme terminé lorsqu’une structure de tableau est définie d’un commun accord et appliquée de manière cohérente, tout en préservant les descriptions nécessaires, les liens d’API et les informations de version.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
documentation
Type d'issue
Documentation
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.