Skip to content

Commit ad72ef3

Browse files
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.
1 parent b0d75d9 commit ad72ef3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gitlab/base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
import importlib
19+
from types import ModuleType
1920
from typing import Any, Dict, Optional, Type
2021

2122
from .client import Gitlab, GitlabList
@@ -38,7 +39,12 @@ class RESTObject(object):
3839
without ID in the url.
3940
"""
4041

41-
_id_attr = "id"
42+
_id_attr: Optional[str] = "id"
43+
_attrs: Dict[str, Any]
44+
_module: ModuleType
45+
_parent_attrs: Dict[str, Any]
46+
_updated_attrs: Dict[str, Any]
47+
manager: "RESTManager"
4248

4349
def __init__(self, manager: "RESTManager", attrs: Dict[str, Any]) -> None:
4450
self.__dict__.update(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy