On 12Aug2014 02:07, Steven D'Aprano <[email protected]> 
wrote:
INADA Naoki wrote:

On Python 3, print is thread safe.
But Python 2 has broken scenario:

Is this documented somewhere?

In python/2.7.6/reference/simple_stmts.html#index-22, "print" is described in terms of a "write" for each object, and a "write" for the separators. There is no mention of locking.

On that basis, I would find the interleaving described normal and expected. And certainly not "broken".

Just use a lock! And rebind "print"! Or use the logging system!

Cheers,
Cameron Simpson <[email protected]>

Wow!  Yet another place that I've been quoted...
        - Andy Beals <[email protected]>
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to