mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Enable mypy disallow_untyped_defs (#2609)
This commit is contained in:
+5
-3
@@ -20,6 +20,8 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
import github.GithubObject
|
||||
|
||||
|
||||
@@ -28,7 +30,7 @@ class Topic(github.GithubObject.NonCompletableGithubObject):
|
||||
This class represents topics as used by https://github.com/topics. The object reference can be found here https://docs.github.com/en/rest/reference/search#search-topics
|
||||
"""
|
||||
|
||||
def __repr__(self):
|
||||
def __repr__(self) -> str:
|
||||
return self.get__repr__({"name": self._name.value})
|
||||
|
||||
@property
|
||||
@@ -108,7 +110,7 @@ class Topic(github.GithubObject.NonCompletableGithubObject):
|
||||
"""
|
||||
return self._score.value
|
||||
|
||||
def _initAttributes(self):
|
||||
def _initAttributes(self) -> None:
|
||||
self._name = github.GithubObject.NotSet
|
||||
self._display_name = github.GithubObject.NotSet
|
||||
self._short_description = github.GithubObject.NotSet
|
||||
@@ -121,7 +123,7 @@ class Topic(github.GithubObject.NonCompletableGithubObject):
|
||||
self._curated = github.GithubObject.NotSet
|
||||
self._score = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
if "name" in attributes: # pragma no branch
|
||||
self._name = self._makeStringAttribute(attributes["name"])
|
||||
if "display_name" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user