Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#626 5 Kommentare 5 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@mohitCodepy arbeitet bereits daran.

Seit 13.3.2023.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

api: core help wanted type: feature request

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.

Vorherrschende Sprache
Python
Sterne
1.2k
Forks
359
Ø Merge
3 T. 9 Std.
Gemergte PRs (30 T.)
3

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus firebase/firebase-admin-python

Alle Issues in firebase/firebase-admin-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.