More precise typing for MainClass.get_user() (#1575)

Use typing.overload for MainClass.get_user() since it can return two
disparate types. Correct the docstring for it, as well as locking down
Sphinx to <3 due to built docs issue and drive-by link correction.

Fixes #1550
This commit is contained in:
Steve Kowalik
2020-06-24 16:21:18 +10:00
committed by GitHub
parent f0f6ec83dd
commit 3668f866e3
5 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -257,7 +257,7 @@ class Github(object):
"""
:calls: `GET /users/:user <http://developer.github.com/v3/users>`_ or `GET /user <http://developer.github.com/v3/users>`_
:param login: string
:rtype: :class:`github.NamedUser.NamedUser`
:rtype: :class:`github.NamedUser.NamedUser` or :class:`github.AuthenticatedUser.AuthenticatedUser`
"""
assert login is github.GithubObject.NotSet or isinstance(login, str), login
if login is github.GithubObject.NotSet: