Skip to content

Commit c14d298

Browse files
committed
Note that context managers are not thread-safe
This comes from GitHub issue #83. Using bitmath context-managers, including the plural formatter, is not guaranteed to format instances as desired and may cause errors. Workaround included in doc update.
1 parent 01f5999 commit c14d298

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docsite/source/module.rst

+11
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,17 @@ This section describes all of the `context managers
535535
<https://docs.python.org/2/reference/datamodel.html#context-managers>`_
536536
provided by the bitmath class.
537537

538+
.. warning::
539+
540+
It is a known limitation that the bitmath context managers are
541+
**not thread-safe**. You may get unexpected results or errors using
542+
these in a threaded environment.
543+
544+
The suggested workaround is to apply formatting to each object
545+
instance directly. See the instance :ref:`format
546+
<instances_format>` method docs for additional reference.
547+
548+
538549
.. note::
539550

540551
For a bit of background, a *context manager* (specifically, the

0 commit comments

Comments
 (0)