diff options
author | John L. Villalovos <john@sodarock.com> | 2021-03-07 11:31:23 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-03-10 08:37:07 -0800 |
commit | 147f05d43d302d9a04bc87d957c79ce9e54cdaed (patch) | |
tree | bb639917a30dbb3de31bf6e47ea022794626bc1c /gitlab/base.py | |
parent | 6fde2437e82aeb8af903f81e351790b4695074a1 (diff) | |
download | gitlab-147f05d43d302d9a04bc87d957c79ce9e54cdaed.tar.gz |
chore: add _create_attrs & _update_attrs to RESTManager
Add the attributes: _create_attrs and _update_attrs to the RESTManager
class. This is so that we stop using getattr() if we don't need to.
This also helps with type-hints being available for these attributes.
Diffstat (limited to 'gitlab/base.py')
-rw-r--r-- | gitlab/base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gitlab/base.py b/gitlab/base.py index 62ace95..5eb1118 100644 --- a/gitlab/base.py +++ b/gitlab/base.py @@ -17,7 +17,7 @@ import importlib from types import ModuleType -from typing import Any, Dict, Optional, Type +from typing import Any, Dict, Optional, Tuple, Type from .client import Gitlab, GitlabList from gitlab import types as g_types @@ -258,6 +258,8 @@ class RESTManager(object): ``_obj_cls``: The class of objects that will be created """ + _create_attrs: Tuple[Tuple[str, ...], Tuple[str, ...]] = (tuple(), tuple()) + _update_attrs: Tuple[Tuple[str, ...], Tuple[str, ...]] = (tuple(), tuple()) _path: Optional[str] = None _obj_cls: Optional[Type[RESTObject]] = None _from_parent_attrs: Dict[str, Any] = {} |