Skip to content

Commit 8cdc0e2

Browse files
cbm755jamie-lemon
authored andcommitted
TextWriter: clarify precisely what warn=None/True/False do
1 parent 4f2cc87 commit 8cdc0e2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/textwriter.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ Using this object entails three steps:
125125
:arg float fontsize: the :data:`fontsize`.
126126
:arg int align: text alignment. Use one of TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT or TEXT_ALIGN_JUSTIFY.
127127
:arg bool right_to_left: *(New in v1.18.9)* whether the text should be written from right to left. Applicable for languages like Arabian or Hebrew. Default is ``False``. If ``True``, any Latin parts are automatically reverted. You must still set the alignment (if you want right alignment), it does not happen automatically -- the other alignment options remain available as well.
128-
:arg bool warn: on text overflow do nothing, warn, or raise an exception. Overflow text will never be written. **Changed in v1.18.9:**
128+
:arg bool warn: on text overflow do nothing (``None``), warn (``True``), or raise an exception (``False``). Overflow text will never be written. **Changed in v1.18.9:**
129129

130130
* Default is ``None``.
131131
* The list of overflow lines will be returned.
132+
* When ``None`` or ``True`` the partial text will be written.
133+
* When ``False``, and an exception is raised, the text *will not* be written.
132134

133135
:arg bool small_caps: *(New in v1.18.15)* see :meth:`append`.
134136

0 commit comments

Comments
 (0)