<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 13 December 2017 at 22:35, Yury Selivanov <span dir="ltr"><<a href="mailto:yselivanov.ml@gmail.com" target="_blank">yselivanov.ml@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[..]<br>
<span class="">>> A new standard library module ``contextvars`` is added<br>
><br>
> Why not add this to contextlib instead of adding a new module?  IIRC<br>
> this was discussed relative to PEP 550, but I don't remember the<br>
> reason.  Regardless, it would be worth mentioning somewhere in the<br>
> PEP.<br>
><br>
<br>
</span>The mechanism is generic and isn't directly related to context<br>
managers.  Context managers can (and in many cases should) use the new<br>
APIs to store global state, but the contextvars APIs do not depend on<br>
context managers or require them.<br>
<br></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">This was the main point of confusion for me when reading the PEP.</div><div class="gmail_extra">Concept of TLS is independent of context managers, but using word "context"</div><div class="gmail_extra">everywhere leads to doubts like "Am I getting everything right?" I think just adding the</div><div class="gmail_extra">two quoted sentences will clarify the intent.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Otherwise the PEP is easy to read, the proposed API looks simple, and this</div><div class="gmail_extra">definitely will be a useful feature.</div><div class="gmail_extra"><br></div><div class="gmail_extra">--</div><div class="gmail_extra">Ivan</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>