MCPcopy Create free account
hub / github.com/scanny/python-pptx / __getitem__

Method __getitem__

src/pptx/opc/package.py:511–516  ·  view source on GitHub ↗

Implement relationship lookup by rId using indexed access, like rels[rId].

(self, rId: str)

Source from the content-addressed store, hash-verified

509 return rId in self._rels
510
511 def __getitem__(self, rId: str) -> _Relationship:
512 """Implement relationship lookup by rId using indexed access, like rels[rId]."""
513 try:
514 return self._rels[rId]
515 except KeyError:
516 raise KeyError("no relationship with key '%s'" % rId)
517
518 def __iter__(self) -> Iterator[str]:
519 """Implement iteration of rIds (iterating a mapping produces its keys)."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected