microsoft / azure-devops-python-api

Azure DevOps Python API
https://docs.microsoft.com/azure/devops/integrate/index?view=azure-devops
MIT License
577 stars 197 forks source link

Implement type hints on top of docstring `rtype` #483

Open Frankkkkk opened 7 months ago

Frankkkkk commented 7 months ago

Hi,

The code is quite well documented, and uses docstring heavily. However, the "Python way" is to use type hints which are powerful and enable a good code completion.

For exaample, the client factory (get_git_client, get_build_client, ...) does not have type hints. Due to how it is written, python analyzers can not infer the returned types and this breaks autocompletion.

Could you please generate them them?

For example something like this:

    def get_git_client(self) -> GitClient:
        """get_git_client.
        Gets the 7.0 version of the GitClient
        :rtype: :class:`<GitClient> <azure.devops.v7_0.git.git_client.GitClient>`
        """
        return self._connection.get_client('azure.devops.v7_0.git.git_client.GitClient')

Thanks !