diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-16 23:09:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 23:09:08 +0100 |
commit | 0951989cc4eaabc2e2bd82adeb38936d145ddec2 (patch) | |
tree | 32cc9473ec28cc3d10be3baff28a74e8a17ac718 /gitlab/v4/objects/packages.py | |
parent | a553ee76affc6e1030ab0464a8bb998168239f4a (diff) | |
parent | 46773a82565cef231dc3391c12f296ac307cb95c (diff) | |
download | gitlab-0951989cc4eaabc2e2bd82adeb38936d145ddec2.tar.gz |
Merge pull request #1681 from python-gitlab/jlvillal/mypy_ensure_type_hints
Ensure get() methods have correct type-hints
Diffstat (limited to 'gitlab/v4/objects/packages.py')
-rw-r--r-- | gitlab/v4/objects/packages.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gitlab/v4/objects/packages.py b/gitlab/v4/objects/packages.py index d992303..0062067 100644 --- a/gitlab/v4/objects/packages.py +++ b/gitlab/v4/objects/packages.py @@ -5,7 +5,7 @@ https://docs.gitlab.com/ee/user/packages/generic_packages/ """ from pathlib import Path -from typing import Any, Callable, Optional, TYPE_CHECKING, Union +from typing import Any, Callable, cast, Optional, TYPE_CHECKING, Union import requests @@ -167,6 +167,11 @@ class ProjectPackageManager(ListMixin, GetMixin, DeleteMixin, RESTManager): "package_name", ) + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> ProjectPackage: + return cast(ProjectPackage, super().get(id=id, lazy=lazy, **kwargs)) + class ProjectPackageFile(RESTObject): pass |