diff options
author | John L. Villalovos <john@sodarock.com> | 2021-04-24 12:48:41 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-04-24 12:55:32 -0700 |
commit | 3c1a0b3ba1f529fab38829c9d355561fd36f4f5d (patch) | |
tree | 42a35b6eb7b94a3e51d9182914f456e00667e85e /gitlab/mixins.py | |
parent | cfc42d246a4fc9a9afa9a676efcac0774e909aab (diff) | |
download | gitlab-3c1a0b3ba1f529fab38829c9d355561fd36f4f5d.tar.gz |
chore: make Get.*Mixin._optional_get_attrs always present
Always create GetMixin/GetWithoutIdMixin._optional_get_attrs attribute
with a default value of tuple()
This way we don't need to use hasattr() and we will know the type of
the attribute.
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index a22fea4..d078a74 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -22,6 +22,7 @@ from typing import ( Dict, List, Optional, + Tuple, Type, TYPE_CHECKING, Union, @@ -74,6 +75,7 @@ class GetMixin(_RestManagerBase): _computed_path: Optional[str] _from_parent_attrs: Dict[str, Any] _obj_cls: Optional[Type[base.RESTObject]] + _optional_get_attrs: Tuple[str, ...] = () _parent: Optional[base.RESTObject] _parent_attrs: Dict[str, Any] _path: Optional[str] @@ -118,6 +120,7 @@ class GetWithoutIdMixin(_RestManagerBase): _computed_path: Optional[str] _from_parent_attrs: Dict[str, Any] _obj_cls: Optional[Type[base.RESTObject]] + _optional_get_attrs: Tuple[str, ...] = () _parent: Optional[base.RESTObject] _parent_attrs: Dict[str, Any] _path: Optional[str] |