MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / _makeDictOfStringsToClassesAttribute

Method _makeDictOfStringsToClassesAttribute

github/GithubObject.py:444–459  ·  view source on GitHub ↗
(
        self,
        klass: type[T_gh],
        value: dict[
            str,
            int | dict[str, Any],
        ],
    )

Source from the content-addressed store, hash-verified

442 return _BadAttribute(value, [dict])
443
444 def _makeDictOfStringsToClassesAttribute(
445 self,
446 klass: type[T_gh],
447 value: dict[
448 str,
449 int | dict[str, Any],
450 ],
451 ) -> Attribute[dict[str, T_gh]]:
452 if isinstance(value, dict) and all(
453 isinstance(key, str) and isinstance(element, dict) for key, element in value.items()
454 ):
455 return _ValuedAttribute(
456 {key: klass(self._requester, self._headers, element) for key, element in value.items()}
457 )
458 else:
459 return _BadAttribute(value, {str: dict})
460
461 @property
462 def etag(self) -> str | None:

Callers 2

_useAttributesMethod · 0.80
_useAttributesMethod · 0.80

Calls 2

_ValuedAttributeClass · 0.85
_BadAttributeClass · 0.85

Tested by

no test coverage detected