summaryrefslogtreecommitdiff
path: root/gitlab/base.py
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2021-02-26 11:24:38 -0800
committerJohn L. Villalovos <john@sodarock.com>2021-02-26 11:26:14 -0800
commitcbd43d0b4c95e46fc3f1cffddc6281eced45db4a (patch)
treee6a776052b3a32fc5113f60fc6903c4650ffbedf /gitlab/base.py
parentf909caea0d1edc779cf6139af769346013bbe358 (diff)
downloadgitlab-cbd43d0b4c95e46fc3f1cffddc6281eced45db4a.tar.gz
chore: improve type-hints for gitlab/base.py
Determined the base class for obj_cls and adding type-hints for it.
Diffstat (limited to 'gitlab/base.py')
-rw-r--r--gitlab/base.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/gitlab/base.py b/gitlab/base.py
index f0bedc7..ac3b962 100644
--- a/gitlab/base.py
+++ b/gitlab/base.py
@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import importlib
-from typing import Any, Dict, Optional
+from typing import Any, Dict, Optional, Type
from .client import Gitlab, GitlabList
@@ -171,7 +171,9 @@ class RESTObjectList(object):
_list: A GitlabList object
"""
- def __init__(self, manager: "RESTManager", obj_cls, _list: GitlabList) -> None:
+ def __init__(
+ self, manager: "RESTManager", obj_cls: Type[RESTObject], _list: GitlabList
+ ) -> None:
"""Creates an objects list from a GitlabList.
You should not create objects of this type, but use managers list()
@@ -246,7 +248,7 @@ class RESTManager(object):
"""
_path: Optional[str] = None
- _obj_cls: Optional[Any] = None
+ _obj_cls: Optional[Type[RESTObject]] = None
_from_parent_attrs: Dict[str, Any] = {}
def __init__(self, gl: Gitlab, parent: Optional[RESTObject] = None) -> None: