Skip to content

Commit 134a82c

Browse files
committed
pythongh-118392: Add warning about random.random for multi thread app
1 parent 23d0371 commit 134a82c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/random.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ be found in any statistics text.
294294

295295
Return the next random floating point number in the range ``0.0 <= X < 1.0``
296296

297+
.. warning::
298+
Directly calling this function in a multithreaded application can cause the
299+
performance degradation. Instead, use the :class:`Random` per thread.
300+
297301

298302
.. function:: uniform(a, b)
299303

0 commit comments

Comments
 (0)