google-api-python-client icon indicating copy to clipboard operation
google-api-python-client copied to clipboard

Add Documentation for `google-api-python-client-stubs` or Provide Built-in Type Annotations

Open Demianeen opened this issue 1 year ago • 0 comments

While resolving #2537, I discovered that the root cause of my confusion was a lack of type safety for build function. I initially passed credentials as a positional argument instead of using the credentials= keyword, which could have been caught immediately if the method signature and documentation were more explicit.

What I mean, this is how types look for build function: Arc 2024-12-19 07 27 57

I found that python has stubs feature, similar to @types packages in npm, but there was no mention of it in google docs. Which bings me to this issue.

It would be ideal to provide built-in type annotation. But as a workaround it would be really beneficial to add mention of google-api-python-client-stubs in the docs. It will help new python users like myself help avoid such simple and time-consuming mistakes.

Demianeen avatar Dec 19 '24 08:12 Demianeen