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

Commitad72ef3

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__. Sodeclare them in the class definition.
1 parentb0d75d9 commitad72ef3

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

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

[8]ページ先頭

©2009-2025 Movatter.jp