googleapis / googleapis/google-cloud-python

Make __all__ expose classes for use in type annotations

Ouverte
#15,640 1 commentaire 0 réactions 1 personne assignée Réclamée par @abbrowne126 Voir sur GitHub
api: pubsub type: feature request
Langage dominant
Python
Étoiles
5.4k
Forks
1.8k
Merge moyen
3 j 4 h
PR mergées (30 j)
122

Description

**Is your feature request related to a problem? Please describe.**
I would like to type annotate my Pubsub subscriber callback as:
`callable[[pubsub_v1.subscriber.message.Message], None]` to match the callback function signature described here: https://cloud.google.com/pubsub/docs/publish-receive-messages-client-library

However, when I do this, my IDE (PyCharm) complains saying: `Cannot find reference 'message' in '__init__.py'`

This is because `pubsub_v1.subscriber.__init__.py` only has `__all__ = ("Client",)`, meaning this is all that is suggested as an exported value.

**Describe the solution you'd like**
Expose the `pubsub_v1.subscriber.message.Message` in `__all__` so I can add type annotations. I expect there are other types that it would be helpful to expose here too.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.