MCPcopy
hub / github.com/PyGithub/PyGithub / __makeSimpleListAttribute

Method __makeSimpleListAttribute

github/GithubObject.py:308–312  ·  view source on GitHub ↗
(value: list, type: type[T])

Source from the content-addressed store, hash-verified

306
307 @staticmethod
308 def __makeSimpleListAttribute(value: list, type: type[T]) -> Attribute[T]:
309 if isinstance(value, list) and all(isinstance(element, type) for element in value):
310 return _ValuedAttribute(value) # type: ignore
311 else:
312 return _BadAttribute(value, [type]) # type: ignore
313
314 @staticmethod
315 def __makeTransformedAttribute(value: T, type: type[T], transform: Callable[[T], K]) -> Attribute[K]:

Calls 2

_ValuedAttributeClass · 0.85
_BadAttributeClass · 0.85

Tested by

no test coverage detected