MCPcopy
hub / github.com/PyGithub/PyGithub / _makeUnionClassAttributeFromTypeKey

Method _makeUnionClassAttributeFromTypeKey

github/GithubObject.py:393–404  ·  view source on GitHub ↗
(
        self,
        type_key: str,
        default_type: str | None,
        value: Any,
        *class_and_names: tuple[type[T_gh], str],
    )

Source from the content-addressed store, hash-verified

391 return _BadAttribute(value, type) # type: ignore
392
393 def _makeUnionClassAttributeFromTypeKey(
394 self,
395 type_key: str,
396 default_type: str | None,
397 value: Any,
398 *class_and_names: tuple[type[T_gh], str],
399 ) -> Attribute[T_gh]:
400 if value is None or not isinstance(value, dict):
401 return _ValuedAttribute(None) # type: ignore
402 return self._makeUnionClassAttributeFromTypeName(
403 value.get(type_key, default_type), default_type, value, *class_and_names
404 )
405
406 def _makeUnionClassAttributeFromTypeKeyAndValueKey(
407 self,

Callers 13

_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80
_useAttributesMethod · 0.80

Calls 3

_ValuedAttributeClass · 0.85
getMethod · 0.80

Tested by

no test coverage detected