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

Commit7cf35b2

Browse files
chore: require kwargs forutils.copy_dict()
The non-keyword arguments were a tiny bit confusing as the destination wasfirst and the source was second.Change the order and require key-word only arguments to ensure wedon't silently break anyone.
1 parent64d01ef commit7cf35b2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎gitlab/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def http_request(
647647
url=self._build_url(path)
648648

649649
params:Dict[str,Any]= {}
650-
utils.copy_dict(params,query_data)
650+
utils.copy_dict(src=query_data,dest=params)
651651

652652
# Deal with kwargs: by default a user uses kwargs to send data to the
653653
# gitlab server, but this generates problems (python keyword conflicts
@@ -656,12 +656,12 @@ def http_request(
656656
# value as arguments for the gitlab server, and ignore the other
657657
# arguments, except pagination ones (per_page and page)
658658
if"query_parameters"inkwargs:
659-
utils.copy_dict(params,kwargs["query_parameters"])
659+
utils.copy_dict(src=kwargs["query_parameters"],dest=params)
660660
forargin ("per_page","page"):
661661
ifarginkwargs:
662662
params[arg]=kwargs[arg]
663663
else:
664-
utils.copy_dict(params,kwargs)
664+
utils.copy_dict(src=kwargs,dest=params)
665665

666666
opts=self._get_session_opts()
667667

‎gitlab/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ def response_content(
4444
returnNone
4545

4646

47-
defcopy_dict(dest:Dict[str,Any],src:Dict[str,Any])->None:
47+
defcopy_dict(
48+
*,
49+
src:Dict[str,Any],
50+
dest:Dict[str,Any],
51+
)->None:
4852
fork,vinsrc.items():
4953
ifisinstance(v,dict):
5054
# Transform dict values to new attributes. For example:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp