List generic arguments for `collections.abc` base classes in documentation
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Documentation
When #123544 lands, we'll have PEP585-related documentation spread even further than before. Deprecated aliases in typing correctly list the generic arguments, but are otherwise undocumented - all such entries boil down to "deprecated in favour of collections.abc.X".
Several relevant changes were discussed along #123523.
There's no direct way for a user to find generic parameters of collections.abc.Generator - they are listed for typing.Generator and in "annotating generators and coroutines" section in typing docs (the latter linked from collections.abc.Generator, though).
I'm certain that generic arguments represent an essential part of class' "signature" - basic amount of information we need to see to use it somehow.
However, collections.abc is not really a type-hinting module, hence providing those signatures there directly can add too much cognitive load.
As of now, my best suggestion is to introduce "Type parameters" section for each generic alias there, like this:
.. class:: Mapping
MutableMapping
ABCs for read-only and mutable :term:`mappings <mapping>`.
Type arguments:
* ``Mapping[KT, VT_co](Collection[KT])``
* ``MutableMapping[KT, VT](Mapping[KT, VT])``
cc @AA-Turner and @AlexWaygood - we started this discussion in the PR above.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza revisando la documentación existente de collections.abc, las listas de argumentos genéricos para los alias de typing obsoletos y las discusiones relacionadas en #123544 y #123523. Añade secciones coherentes de Type parameters para los alias genéricos pertinentes, con sus argumentos y relaciones, y verifica que los usuarios puedan encontrar la información desde las entradas de collections.abc.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100