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

Method __getitem__

src/pptx/slide.py:356–362  ·  view source on GitHub ↗

Provides indexed access, e.g. `slide_layouts[2]`.

(self, idx: int)

Source from the content-addressed store, hash-verified

354 self._sldLayoutIdLst = sldLayoutIdLst
355
356 def __getitem__(self, idx: int) -> SlideLayout:
357 """Provides indexed access, e.g. `slide_layouts[2]`."""
358 try:
359 sldLayoutId = self._sldLayoutIdLst.sldLayoutId_lst[idx]
360 except IndexError:
361 raise IndexError("slide layout index out of range")
362 return self.part.related_slide_layout(sldLayoutId.rId)
363
364 def __iter__(self) -> Iterator[SlideLayout]:
365 """Generate each |SlideLayout| in the collection, in sequence."""

Callers

nothing calls this directly

Calls 1

related_slide_layoutMethod · 0.80

Tested by

no test coverage detected