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

Method __getitem__

src/pptx/table.py:459–464  ·  view source on GitHub ↗

Provides indexed access, (e.g. 'columns[0]').

(self, idx: int)

Source from the content-addressed store, hash-verified

457 self._tbl = tbl
458
459 def __getitem__(self, idx: int):
460 """Provides indexed access, (e.g. 'columns[0]')."""
461 if idx < 0 or idx >= len(self._tbl.tblGrid.gridCol_lst):
462 msg = "column index [%d] out of range" % idx
463 raise IndexError(msg)
464 return _Column(self._tbl.tblGrid.gridCol_lst[idx], self)
465
466 def __len__(self):
467 """Supports len() function (e.g. 'len(columns) == 1')."""

Callers

nothing calls this directly

Calls 1

_ColumnClass · 0.85

Tested by

no test coverage detected