question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Description

It would be quite useful for this library to support Python with type hints. An obvious benefit is that users of the library, if using mypy or similar, are able to verify that they are using library in correct way, avoiding situations like:

  • typos
  • input data mismatch
  • output data mismatch

There are 2 ways to do that:

  • resolving #207 first and baking annotations directly into codebase as a preferable method mentioned here
  • getting an 👍 from this library maintainers and pushing stubs into python/typeshed library

Either works for me. I acknowledge that first option requires a lot of thinking and preparation whilst 2nd one is simply easier for auth0-python to keep compatibility with older Python versions for a little longer. I am willing to help with either #207 or this issue (either here or in typeshed)

Prerequisites

Environment

  • auth0-python==3.9.1
  • other factors does not seem to be relevant

Reproduction

I believe that an example like so is enough:

class TypingShowsAny:
   def __init__(domain: str, access_token: str) -> None:
      self._client = client = auth0.v3.management.Clients(domain, access_token)
      reveal_type(client) 

reveal_type reports Any whilst it should report auth0.v3.management.Clients

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
stale[bot]commented, Nov 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

2reactions
emosenkiscommented, Aug 16, 2022

Can this be reopened? Type hints would be very nice to have and it’s increasingly unusual for an SDK not to either include them or have external stubs in typeshed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript: Adding Custom Type Definitions for Existing ...
In these circumstances, you have to add your own custom type definitions for the libraries. This article will show you how to that....
Read more >
How to add custom "typings" in typescript 2.0 / 3.0
You can create local custom typings just for your project, where you can declare types for JS libraries. For that, you need to:....
Read more >
How to add custom types into the TypeScript project - drag13.io
Tutorial how to add custom types (typings) for the third-party code into the TypeScript project or how to solve "could not find a...
Read more >
Adding Custom Type Definitions to a Third-Party Library
Add an index.d.ts file with your typings into that folder: types/third-party-library-name/index.d.ts. 5. Add your type definition.
Read more >
Documentation - Creating .d.ts Files from .js files - TypeScript
Run the TypeScript compiler to generate the corresponding d.ts files for JS files; (optional) Edit your package.json to reference the types. Adding TypeScript....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found