A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20180116/63a86268/attachment.html below:

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 16, 2018 at 5:33 PM, 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">On Tue, Jan 16, 2018 at 8:27 PM, Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br>
[..]<br>
> token = cvar.set(...)<br>
> token.reset()<br>
<br>
I see the point, but I think that having the 'reset' method defined on<br>
the ContextVar class is easier to grasp.  It also feels natural that a<br>
pair of set/reset methods is defined on the same class.  This is<br>
highly subjective though, so let's see which option Guido likes more.<span class="HOEnZb"></span><br></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">I think this came up in one of the previous reviews of the PEP. I like Yury's (redundant) version -- it makes it clear to the human reader of the code which variable is being reset. And it's not like it's going to be used that much -- it'll be likely hidden inside a context manager.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</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