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

Method _is_empty

src/docx/oxml/table.py:606–614  ·  view source on GitHub ↗

True if this cell contains only a single empty `w:p` element.

(self)

Source from the content-addressed store, hash-verified

604
605 @property
606 def _is_empty(self) -> bool:
607 """True if this cell contains only a single empty `w:p` element."""
608 block_items = list(self.iter_block_items())
609 if len(block_items) > 1:
610 return False
611 # -- cell must include at least one block item but can be a `w:tbl`, `w:sdt`,
612 # -- `w:customXml` or a `w:p`
613 only_item = block_items[0]
614 return isinstance(only_item, CT_P) and len(only_item.r_lst) == 0
615
616 def _move_content_to(self, other_tc: CT_Tc):
617 """Append the content of this cell to `other_tc`.

Callers

nothing calls this directly

Calls 1

iter_block_itemsMethod · 0.95

Tested by

no test coverage detected