MCPcopy Index your code
hub / github.com/python-openxml/python-docx / __getitem__

Method __getitem__

src/docx/table.py:358–365  ·  view source on GitHub ↗

Provide indexed access, e.g. 'columns[0]'.

(self, idx: int)

Source from the content-addressed store, hash-verified

356 self._tbl = tbl
357
358 def __getitem__(self, idx: int):
359 """Provide indexed access, e.g. 'columns[0]'."""
360 try:
361 gridCol = self._gridCol_lst[idx]
362 except IndexError:
363 msg = "column index [%d] is out of range" % idx
364 raise IndexError(msg)
365 return _Column(gridCol, self)
366
367 def __iter__(self):
368 for gridCol in self._gridCol_lst:

Callers

nothing calls this directly

Calls 1

_ColumnClass · 0.85

Tested by

no test coverage detected