Showing content from http://mail.python.org/pipermail/python-dev/attachments/20171123/ce3bc07e/attachment.html below:
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 23 November 2017 at 19:42, Chris Jerdonek <span dir="ltr"><<a href="mailto:chris.jerdonek@gmail.com" target="_blank">chris.jerdonek@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-">On Wed, Nov 22, 2017 at 4:32 PM, Victor Stinner <span dir="ltr"><<a href="mailto:victor.stinner@gmail.com" target="_blank">victor.stinner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Aha, contextlib.nullcontext() was just added, cool!<br></blockquote><div><br></div></span><div>So is this equivalent to--<br></div><div><div><div><br></div><div>  @contextmanager</div><div>  def yielding(x):</div><div>    yield x</div></div><div><br></div><div>I thought we were against adding one-line functions?</div></div></div></div></div></blockquote><div><br></div><div>There's a lot of runtime complexity hiding behind that "@contextmanager" line, so I'm open to `contextlib` additions that make it possible for sufficiently common patterns to avoid it. (The explicit class based nullcontext() implementation is 7 lines, the same as contextlib.closing())<br></div><div><br></div><div>After 7+ years, I'm happy that this one comes up often enough to be worth a more obvious standard library level answer than we'd previously offered. <a href="https://bugs.python.org/issue10049#msg281556">https://bugs.python.org/issue10049#msg281556</a> captures the point where I really started changing my mind.<br></div><div><br></div><div>Cheers,</div><div>Nick.<br clear="all"></div></div><br>-- <br><div class="gmail_signature">Nick Coghlan  |  <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>  |  Brisbane, Australia</div>
</div></div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4