New submission from Timothy Pederick:

The docs are contradictory on whether or not contextlib.redirect_stdout is 
reentrant, or reusable-but-not-reentrant. This would seem to be an oversight 
from issue19403, which probably should have changed "reusable but not 
reentrant" to "reentrant".

Present in both current and upcoming docs:
  http://docs.python.org/3/library/contextlib.html
  http://docs.python.org/3.5/library/contextlib.html

contextlib.redirect_stdout(new_target)
  ...
  This context manager is reusable but not reentrant.

29.6.3.1. Reentrant context managers
  ...
  threading.RLock is an example of a reentrant context manager, as are 
suppress() and redirect_stdout().
  ...
  Note also that being reentrant is not the same thing as being thread safe. 
redirect_stdout(), for example...

----------
assignee: docs@python
components: Documentation
messages: 214801
nosy: docs@python, perey
priority: normal
severity: normal
status: open
title: Is contextlib.redirect_stdout reentrant or not?
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21061>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to