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

Commit36d9b24

Browse files
igorp-collaboranejch
authored andcommitted
feat(api): Narrow down return type of ProjectFileManager.raw using typing.overload
This is equivalent to the changes in44fd9dcbut for `ProjectFileManager.raw` method that I must have missedin the original commit.Signed-off-by: Igor Ponomarev <igor.ponomarev@collabora.com>
1 parent175b355 commit36d9b24

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

‎gitlab/v4/objects/files.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
Dict,
66
Iterator,
77
List,
8+
Literal,
89
Optional,
10+
overload,
911
Tuple,
1012
TYPE_CHECKING,
1113
Union,
@@ -274,6 +276,45 @@ def delete( # type: ignore[override]
274276
data= {"branch":branch,"commit_message":commit_message}
275277
self.gitlab.http_delete(path,query_data=data,**kwargs)
276278

279+
@overload
280+
defraw(
281+
self,
282+
file_path:str,
283+
ref:Optional[str]=None,
284+
streamed:Literal[False]=False,
285+
action:None=None,
286+
chunk_size:int=1024,
287+
*,
288+
iterator:Literal[False]=False,
289+
**kwargs:Any,
290+
)->bytes: ...
291+
292+
@overload
293+
defraw(
294+
self,
295+
file_path:str,
296+
ref:Optional[str]=None,
297+
streamed:bool=False,
298+
action:None=None,
299+
chunk_size:int=1024,
300+
*,
301+
iterator:Literal[True]=True,
302+
**kwargs:Any,
303+
)->Iterator[Any]: ...
304+
305+
@overload
306+
defraw(
307+
self,
308+
file_path:str,
309+
ref:Optional[str]=None,
310+
streamed:Literal[True]=True,
311+
action:Optional[Callable[[bytes],None]]=None,
312+
chunk_size:int=1024,
313+
*,
314+
iterator:Literal[False]=False,
315+
**kwargs:Any,
316+
)->None: ...
317+
277318
@cli.register_custom_action(
278319
cls_names="ProjectFileManager",
279320
required=("file_path",),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp