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

Method __getitem__

src/docx/text/tabstops.py:31–37  ·  view source on GitHub ↗

Enables list-style access by index.

(self, idx)

Source from the content-addressed store, hash-verified

29 self._pPr.remove(tabs)
30
31 def __getitem__(self, idx):
32 """Enables list-style access by index."""
33 tabs = self._pPr.tabs
34 if tabs is None:
35 raise IndexError("TabStops object is empty")
36 tab = tabs.tab_lst[idx]
37 return TabStop(tab)
38
39 def __iter__(self):
40 """Generate a TabStop object for each of the w:tab elements, in XML document

Callers

nothing calls this directly

Calls 1

TabStopClass · 0.85

Tested by

no test coverage detected