From 5ad091d0182a7abd0dd7da51fc6dc727fc4bb82d Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 4 Aug 2020 17:49:49 +1000 Subject: [PATCH] Correct Repository.create_pull typing harder (#1635) It turns out if an argument is optional for an overloaded method, the type hints require the default argument specified to successfully match against the correct signature. Furthermore, the second kind of create_pull() does not support the draft argument at all, so remove it. Fixes #1634 --- github/Repository.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/Repository.pyi b/github/Repository.pyi index 2a6730a1..e2f1bfa4 100644 --- a/github/Repository.pyi +++ b/github/Repository.pyi @@ -181,9 +181,9 @@ class Repository(CompletableGithubObject): ) -> Milestone: ... def create_project(self, name: str, body: str = ...) -> Project: ... @overload - def create_pull(self, title: str, body: str, base: str, head: str, maintainer_can_modify: Union[bool, _NotSetType], draft: bool, issue: _NotSetType) -> PullRequest: ... + def create_pull(self, title: str, body: str, base: str, head: str, maintainer_can_modify: Union[bool, _NotSetType] = _NotSetType(), draft: bool = False, issue: _NotSetType = _NotSetType()) -> PullRequest: ... @overload - def create_pull(self, title: _NotSetType, body: _NotSetType, base: str, head: str, maintainer_can_modify: _NotSetType, draft: bool, issue: Issue) -> PullRequest: ... + def create_pull(self, title: _NotSetType, body: _NotSetType, base: str, head: str, maintainer_can_modify: _NotSetType, issue: Issue) -> PullRequest: ... def create_repository_dispatch( self, event_type: str, client_payload: Dict[str, str] ) -> bool: ...