Skip to content

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

Open
@guneemwelloeux

Description

@guneemwelloeux

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy