MCPcopy Create free account
hub / github.com/libgit2/pygit2 / __getitem__

Method __getitem__

pygit2/config.py:140–148  ·  view source on GitHub ↗

When using the mapping interface, the value is returned as a string. In order to apply the git-config parsing rules, you can use :meth:`Config.get_bool` or :meth:`Config.get_int`.

(self, key: str | bytes)

Source from the content-addressed store, hash-verified

138 return True
139
140 def __getitem__(self, key: str | bytes) -> str | None:
141 """
142 When using the mapping interface, the value is returned as a string. In
143 order to apply the git-config parsing rules, you can use
144 :meth:`Config.get_bool` or :meth:`Config.get_int`.
145 """
146 entry = self._get_entry(key)
147
148 return entry.value
149
150 def __setitem__(self, key: str | bytes, value: bool | int | str | bytes) -> None:
151 key = str_to_bytes(key, 'key')

Callers

nothing calls this directly

Calls 1

_get_entryMethod · 0.95

Tested by

no test coverage detected