summaryrefslogtreecommitdiff
path: root/gitlab/base.py
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2021-02-27 12:45:41 -0800
committerJohn L. Villalovos <john@sodarock.com>2021-02-27 13:06:17 -0800
commitad72ef35707529058c7c680f334c285746b2f690 (patch)
tree20f00bc859a5d2ee38f78f4fca2330ac8b79902f /gitlab/base.py
parentb0d75d9e6fd4876446498f0aac97ae3f6ec601d5 (diff)
downloadgitlab-ad72ef35707529058c7c680f334c285746b2f690.tar.gz
chore: add additional type-hints for gitlab/base.py
Add type-hints for the variables which are set via self.__dict__ mypy doesn't see them when they are assigned via self.__dict__. So declare them in the class definition.
Diffstat (limited to 'gitlab/base.py')
-rw-r--r--gitlab/base.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/gitlab/base.py b/gitlab/base.py
index 30f0659..a3fdcf7 100644
--- a/gitlab/base.py
+++ b/gitlab/base.py
@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import importlib
+from types import ModuleType
from typing import Any, Dict, Optional, Type
from .client import Gitlab, GitlabList
@@ -38,7 +39,12 @@ class RESTObject(object):
without ID in the url.
"""
- _id_attr = "id"
+ _id_attr: Optional[str] = "id"
+ _attrs: Dict[str, Any]
+ _module: ModuleType
+ _parent_attrs: Dict[str, Any]
+ _updated_attrs: Dict[str, Any]
+ manager: "RESTManager"
def __init__(self, manager: "RESTManager", attrs: Dict[str, Any]) -> None:
self.__dict__.update(