Skip to content

Commit dc94243

Browse files
author
Steve Canny
committed
tbl: base _Cell on BlockItemContainer
* use super() on _Cell.paragraphs rather than inherit so a custom docstring can be provided.
1 parent b9bb316 commit dc94243

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docx/table.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
from __future__ import absolute_import, print_function, unicode_literals
88

9+
from .blkcntnr import BlockItemContainer
910
from .shared import lazyproperty, Parented, write_only_property
10-
from .text import Paragraph
1111

1212

1313
class Table(Parented):
@@ -92,22 +92,22 @@ def _tblPr(self):
9292
return self._tbl.tblPr
9393

9494

95-
class _Cell(Parented):
95+
class _Cell(BlockItemContainer):
9696
"""
9797
Table cell
9898
"""
9999
def __init__(self, tc, parent):
100-
super(_Cell, self).__init__(parent)
100+
super(_Cell, self).__init__(tc, parent)
101101
self._tc = tc
102102

103103
@property
104104
def paragraphs(self):
105105
"""
106106
List of paragraphs in the cell. A table cell is required to contain
107-
at least one block-level element. By default this is a single
108-
paragraph.
107+
at least one block-level element and end with a paragraph. By
108+
default, a new cell contains a single paragraph.
109109
"""
110-
return [Paragraph(p, self) for p in self._tc.p_lst]
110+
return super(_Cell, self).paragraphs
111111

112112
@write_only_property
113113
def text(self, text):

0 commit comments

Comments
 (0)