Small improvements to typing (#1517)

Work through some of the errors when running mypy with --strict.
This commit is contained in:
Steve Kowalik
2020-05-15 10:47:22 +10:00
committed by GitHub
parent 8727003fc8
commit 7b20b13d0b
6 changed files with 17 additions and 15 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ class AuthenticatedUser(CompletableGithubObject):
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
def accept_invitation(self, invitation: Union[int, Invitation]) -> None: ...
def add_to_emails(self, *emails) -> None: ...
def add_to_emails(self, *emails: List[str]) -> None: ...
def add_to_following(self, following: NamedUser) -> None: ...
def add_to_starred(self, starred: Repository) -> None: ...
def add_to_subscriptions(self, subscription: Repository) -> None: ...
+1 -1
View File
@@ -115,7 +115,7 @@ class _BadAttribute:
self, value: Any, expectedType: Any, exception: Optional[ValueError] = ...
) -> None: ...
@property
def value(self): ...
def value(self) -> Any: ...
class _NotSetType:
def __repr__(self) -> str: ...
+10 -6
View File
@@ -102,36 +102,40 @@ class Github:
sort: Union[str, _NotSetType] = ...,
order: Union[str, _NotSetType] = ...,
highlight: bool = ...,
**qualifiers
**qualifiers: Dict[str, Any]
) -> PaginatedList[ContentFile]: ...
def search_commits(
self,
query: str,
sort: Union[str, _NotSetType] = ...,
order: Union[str, _NotSetType] = ...,
**qualifiers
**qualifiers: Dict[str, Any]
) -> PaginatedList[Commit]: ...
def search_issues(
self,
query: str,
sort: Union[str, _NotSetType] = ...,
order: Union[str, _NotSetType] = ...,
**qualifiers
**qualifiers: Dict[str, Any]
) -> PaginatedList[Issue]: ...
def search_repositories(
self,
query: str,
sort: Union[str, _NotSetType] = ...,
order: Union[str, _NotSetType] = ...,
**qualifiers
**qualifiers: Dict[str, Any]
) -> PaginatedList[Repository]: ...
def search_topics(self, query: str, **qualifiers) -> PaginatedList[Topic]: ...
def search_topics(
self,
query: str,
**qualifiers: Dict[str, Any]
) -> PaginatedList[Topic]: ...
def search_users(
self,
query: str,
sort: Union[str, _NotSetType] = ...,
order: Union[str, _NotSetType] = ...,
**qualifiers
**qualifiers: Dict[str, Any]
) -> PaginatedList[NamedUser]: ...
class GithubIntegration:
+1 -2
View File
@@ -6,8 +6,7 @@ from github.NamedUser import NamedUser
from github.Repository import Repository
class Migration(CompletableGithubObject):
def __repr__(self):
str: ...
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
+1 -2
View File
@@ -15,8 +15,7 @@ class Milestone(CompletableGithubObject):
@property
def closed_issues(self) -> int: ...
@property
def created_at(self):
datetime: ...
def created_at(self) -> datetime: ...
@property
def creator(self) -> NamedUser: ...
def delete(self) -> None: ...
+3 -3
View File
@@ -17,7 +17,7 @@ class HTTPRequestsConnectionClass:
strict: bool = ...,
timeout: Optional[int] = ...,
retry: Any = ...,
**kwargs
**kwargs: Dict[str, str]
) -> None: ...
def close(self) -> None: ...
def getresponse(self) -> RequestsResponse: ...
@@ -33,7 +33,7 @@ class HTTPSRequestsConnectionClass:
strict: bool = ...,
timeout: Optional[int] = ...,
retry: Any = ...,
**kwargs
**kwargs: Dict[str, str]
) -> None: ...
def close(self) -> None: ...
def getresponse(self) -> RequestsResponse: ...
@@ -83,7 +83,7 @@ class Requester:
parameters: Dict[str, str] = ...,
headers: Dict[str, str] = ...,
input: Optional[str] = ...,
encode: Callable = ...,
encode: Callable[[str], str] = ...,
) -> Tuple[int, Dict[str, Any], str]: ...
def __requestRaw(
self,