mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Improve type stubs (#1489)
* Add type stubs for GithubException subclasses * Install type stubs per PEP 561 See https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages. * Make PaginatedList a generic type * Add type stubs for __init__.py * Add type stub for NamedUser.get_projects * Add GithubObject superclasses to type stubs Fixes #1490
This commit is contained in:
+17
-17
@@ -8,22 +8,6 @@ from github.Organization import Organization
|
||||
from github.PullRequestReview import PullRequestReview
|
||||
from github.Requester import Requester
|
||||
|
||||
class CompletableGithubObject:
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __init__(
|
||||
self,
|
||||
requester: Requester,
|
||||
headers: Dict[str, Union[str, int]],
|
||||
attributes: Dict[str, Any],
|
||||
completed: bool,
|
||||
) -> None: ...
|
||||
def __ne__(self, other: Any) -> bool: ...
|
||||
def _completeIfNeeded(self) -> None: ...
|
||||
def _completeIfNotSet(
|
||||
self, value: Union[_ValuedAttribute, _BadAttribute, _NotSetType]
|
||||
) -> None: ...
|
||||
def update(self) -> bool: ...
|
||||
|
||||
class GithubObject:
|
||||
def __init__(
|
||||
self,
|
||||
@@ -107,9 +91,25 @@ class GithubObject:
|
||||
@classmethod
|
||||
def setCheckAfterInitFlag(cls, flag: bool) -> None: ...
|
||||
|
||||
class NonCompletableGithubObject:
|
||||
class NonCompletableGithubObject(GithubObject):
|
||||
def _completeIfNeeded(self) -> None: ...
|
||||
|
||||
class CompletableGithubObject(GithubObject):
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __init__(
|
||||
self,
|
||||
requester: Requester,
|
||||
headers: Dict[str, Union[str, int]],
|
||||
attributes: Dict[str, Any],
|
||||
completed: bool,
|
||||
) -> None: ...
|
||||
def __ne__(self, other: Any) -> bool: ...
|
||||
def _completeIfNeeded(self) -> None: ...
|
||||
def _completeIfNotSet(
|
||||
self, value: Union[_ValuedAttribute, _BadAttribute, _NotSetType]
|
||||
) -> None: ...
|
||||
def update(self) -> bool: ...
|
||||
|
||||
class _BadAttribute:
|
||||
def __init__(
|
||||
self, value: Any, expectedType: Any, exception: Optional[ValueError] = ...
|
||||
|
||||
Reference in New Issue
Block a user