Type annotations for public API would be nice

Abierto
#798 0 comentarios 3 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 7 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
22/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
api, tooling

Línea de trabajo

The payload names no specific modules, so the public API surface must be identified first, for example by running Pyright's --verifytypes check the issue suggests to get a baseline of untyped symbols. Annotating those symbols and then adding an empty py.typed marker to the package is the intended change. Done means the chosen public API passes the type-completeness check and the marker ships with the package. The issue has no comments or maintainer decision on scope, so confirm the surface before starting.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Is your feature request related to a problem? Please describe.
Most of the project's public API lacks static type annotations and consequently there is also no py.typed marker that signals to library consumers that their usages of these APIs may be type checked.

Describe the solution you'd like
It would be nice if at least the public API of this project was fully statically typed and then a py.typed marker added so that dependent projects can check that their usages of this library are correct, get type-based IDE autocompletion etc.

Describe alternatives you've considered

  • Wait for a 3rd party to publish a type stubs package. But there already are some type hints in Rope's codebase, so I don't see the point.

Additional context

  • API docs as suggested in #796 would also greatly benefit from type annotations.
  • Pyright's --verifytypes option may be used to check if the public interface is in fact "type complete". Mypy might have something similar in the form of coverage reports.
Lenguaje dominante
Python
Estrellas
2.2k
Forks
197
Merge medio
2 d 13 h
PR fusionados (30 d)
5

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de python-rope/rope

Todos los issues de python-rope/rope

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.