Enable mypy check_untyped_defs (#2607)

This commit is contained in:
Trim21
2023-07-14 14:49:28 +02:00
committed by GitHub
parent 13e178a3ab
commit 8816889a7d
19 changed files with 215 additions and 310 deletions
+3 -2
View File
@@ -55,6 +55,7 @@ if TYPE_CHECKING:
T = typing.TypeVar("T")
K = typing.TypeVar("K")
T_co = typing.TypeVar("T_co", covariant=True)
T_gh = typing.TypeVar("T_gh", bound="GithubObject")
class Attribute(Protocol[T_co]):
@@ -68,7 +69,7 @@ class _NotSetType:
return "NotSet"
@property
def value(self):
def value(self) -> Any:
return None
@staticmethod
@@ -262,7 +263,7 @@ class GithubObject:
) -> Attribute:
return GithubObject.__makeSimpleListAttribute(value, list)
def _makeListOfClassesAttribute(self, klass: Any, value: Any) -> Union[_ValuedAttribute, _BadAttribute]:
def _makeListOfClassesAttribute(self, klass: Type[T_gh], value: Any) -> Attribute[List[T_gh]]:
if isinstance(value, list) and all(isinstance(element, dict) for element in value):
return _ValuedAttribute(
[klass(self._requester, self._headers, element, completed=False) for element in value]