Skip to content

Commit cbd43d0

Browse files
chore: improve type-hints for gitlab/base.py
Determined the base class for obj_cls and adding type-hints for it.
1 parent f909cae commit cbd43d0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gitlab/base.py

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

1818
import importlib
19-
from typing import Any, Dict, Optional
19+
from typing import Any, Dict, Optional, Type
2020

2121
from .client import Gitlab, GitlabList
2222

@@ -171,7 +171,9 @@ class RESTObjectList(object):
171171
_list: A GitlabList object
172172
"""
173173

174-
def __init__(self, manager: "RESTManager", obj_cls, _list: GitlabList) -> None:
174+
def __init__(
175+
self, manager: "RESTManager", obj_cls: Type[RESTObject], _list: GitlabList
176+
) -> None:
175177
"""Creates an objects list from a GitlabList.
176178
177179
You should not create objects of this type, but use managers list()
@@ -246,7 +248,7 @@ class RESTManager(object):
246248
"""
247249

248250
_path: Optional[str] = None
249-
_obj_cls: Optional[Any] = None
251+
_obj_cls: Optional[Type[RESTObject]] = None
250252
_from_parent_attrs: Dict[str, Any] = {}
251253

252254
def __init__(self, gl: Gitlab, parent: Optional[RESTObject] = None) -> None:

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