A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-October/129505.html below:

[Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

[Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore(). [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().Janzert janzert at janzert.com
Sun Oct 13 01:44:05 CEST 2013
On 10/12/2013 6:27 PM, Raymond Hettinger wrote:
>
> On Oct 12, 2013, at 1:41 PM, Ethan Furman <ethan at stoneleaf.us
> <mailto:ethan at stoneleaf.us>> wrote:
>
>> .  break_on reads just fine to me, although leave_on is probably better.
>
> Sorry, these are both really bad.
>
> I've user tested ignore() and had good results.
> It makes the intention of the code very clear.
>

I'm curious what your users think this will do

print("start listing")
with ignore(ZeroDivisionError):
     for i in range(0, 4):
         inv = 1 / i
         print("1 over {} is {}".format(i, inv))
print("finished")

I think there's a decent chance I'd get it wrong if I was scanning 
through code with that construct in the midst of it.

Janzert

More information about the Python-Dev mailing list

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