firebase / firebase/firebase-admin-python

[FR] Add return type annotations for public functions (firestore.client(), storage.bucket(), etc)

Abierto
#626 5 comentarios 5 reacciones 1 asignado Reclamado por @mohitCodepy Ver en GitHub
api: core help wanted type: feature request
Lenguaje dominante
Python
Estrellas
1.2k
Forks
359
Merge medio
5 d 6 min
PR fusionados (30 d)
2

Descripción

**Is your feature request related to a problem? Please describe.**
VSCode can use Python type annotations to provide a much better experience, and allow completion.

**Describe the solution you'd like**
function signatures should return a return type, to allow completions. For example, in firestore.py
`def client() -> google.cloud.firestore.Client` would allow completion on client().collection("something"), etc.

**Describe alternatives you've considered**
As a workaround, I'm using the following today:
```
from firebase_admin import firestore
from google.cloud.firestore import Client as FirestoreClient # importing the return type of firestore.client()
db: FirestoreClient = firestore.client() # Adding an annotation to my db variable, to enable completion and syntax checking
```

**Additional context**
Using the latest VSCode, with the Pylance extension.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.