Skip to content

Commit

Permalink
chore: improve type-hints for gitlab/base.py
Browse files Browse the repository at this point in the history
Determined the base class for obj_cls and adding type-hints for it.
  • Loading branch information
JohnVillalovos committed Feb 26, 2021
1 parent f909cae commit cbd43d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gitlab/base.py
Expand Up @@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import importlib
from typing import Any, Dict, Optional
from typing import Any, Dict, Optional, Type

from .client import Gitlab, GitlabList

Expand Down Expand Up @@ -171,7 +171,9 @@ class RESTObjectList(object):
_list: A GitlabList object
"""

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

_path: Optional[str] = None
_obj_cls: Optional[Any] = None
_obj_cls: Optional[Type[RESTObject]] = None
_from_parent_attrs: Dict[str, Any] = {}

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

0 comments on commit cbd43d0

Please sign in to comment.