Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit90fefb0

Browse files
committed
add overloads to to_progress_instance()
1 parentf97d378 commit90fefb0

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

‎git/remote.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# typing-------------------------------------------------------
3838

39-
fromtypingimportAny,Callable,Optional,TYPE_CHECKING,Union
39+
fromtypingimportAny,Callable,Optional,TYPE_CHECKING,Union,overload
4040

4141
fromgit.typesimportPathLike,Literal
4242

@@ -71,7 +71,23 @@ def add_progress(kwargs: Any, git: Git, progress: Optional[Callable[..., Any]])
7171
#} END utilities
7272

7373

74-
defto_progress_instance(progress:Callable[...,Any])->Union[RemoteProgress,CallableRemoteProgress]:
74+
@overload
75+
defto_progress_instance(progress:None)->RemoteProgress:
76+
...
77+
78+
79+
@overload
80+
defto_progress_instance(progress:Callable[...,Any])->CallableRemoteProgress:
81+
...
82+
83+
84+
@overload
85+
defto_progress_instance(progress:RemoteProgress)->RemoteProgress:
86+
...
87+
88+
89+
defto_progress_instance(progress:Union[Callable[...,Any],RemoteProgress,None]
90+
)->Union[RemoteProgress,CallableRemoteProgress]:
7591
"""Given the 'progress' return a suitable object derived from
7692
RemoteProgress().
7793
"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp