44
55from typing import IO , TYPE_CHECKING , Iterator , cast
66
7- from docx import types as t
87from docx .drawing import Drawing
98from docx .enum .style import WD_STYLE_TYPE
109from docx .enum .text import WD_BREAK
1716from docx .text .pagebreak import RenderedPageBreak
1817
1918if TYPE_CHECKING :
19+ import docx .types as t
2020 from docx .enum .text import WD_UNDERLINE
2121 from docx .oxml .text .run import CT_R , CT_Text
2222 from docx .shared import Length
@@ -170,9 +170,7 @@ def iter_inner_content(self) -> Iterator[str | Drawing | RenderedPageBreak]:
170170 yield item
171171 elif isinstance (item , CT_LastRenderedPageBreak ):
172172 yield RenderedPageBreak (item , self )
173- elif isinstance ( # pyright: ignore[reportUnnecessaryIsInstance]
174- item , CT_Drawing
175- ):
173+ elif isinstance (item , CT_Drawing ): # pyright: ignore[reportUnnecessaryIsInstance]
176174 yield Drawing (item , self )
177175
178176 @property
@@ -185,9 +183,7 @@ def style(self) -> CharacterStyle:
185183 property to |None| removes any directly-applied character style.
186184 """
187185 style_id = self ._r .style
188- return cast (
189- CharacterStyle , self .part .get_style (style_id , WD_STYLE_TYPE .CHARACTER )
190- )
186+ return cast (CharacterStyle , self .part .get_style (style_id , WD_STYLE_TYPE .CHARACTER ))
191187
192188 @style .setter
193189 def style (self , style_or_name : str | CharacterStyle | None ):
0 commit comments