Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbd43d0

Browse files
chore: improve type-hints for gitlab/base.py
Determined the base class for obj_cls and adding type-hints for it.
1 parentf909cae commitcbd43d0

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
importimportlib
19-
fromtypingimportAny,Dict,Optional
19+
fromtypingimportAny,Dict,Optional,Type
2020

2121
from .clientimportGitlab,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)

[8]ページ先頭

©2009-2025 Movatter.jp