Skip to content

Adding typings #208

@kornicameister

Description

@kornicameister

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed:staleIssue or PR has not seen activity recently

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions