Skip to content

Commit 3984328

Browse files
chore: require kwargs for utils.copy_dict()
Non-keyword arguments are a tiny bit confusing as the destination is first and the source is second.
1 parent 64d01ef commit 3984328

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-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(dest=params, src=query_data)
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" in kwargs:
659-
utils.copy_dict(params, kwargs["query_parameters"])
659+
utils.copy_dict(dest=params, src=kwargs["query_parameters"])
660660
for arg in ("per_page", "page"):
661661
if arg in kwargs:
662662
params[arg] = kwargs[arg]
663663
else:
664-
utils.copy_dict(params, kwargs)
664+
utils.copy_dict(dest=params, src=kwargs)
665665

666666
opts = self._get_session_opts()
667667

gitlab/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def response_content(
4444
return None
4545

4646

47-
def copy_dict(dest: Dict[str, Any], src: Dict[str, Any]) -> None:
47+
def copy_dict(*, dest: Dict[str, Any], src: Dict[str, Any]) -> None:
4848
for k, v in src.items():
4949
if isinstance(v, dict):
5050
# Transform dict values to new attributes. For example:

0 commit comments

Comments
 (0)