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/129608.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().Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Oct 15 20:17:15 CEST 2013
On Tue, Oct 15, 2013 at 12:45 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
>     with trap(OSError) as cm:
>         os.unlink('missing.txt')
>     if cm.exc:
>         do_something()

.. and why is this better than

try:
   os.unlink('missing.txt')
except OSError as exc:
   do_something()

?
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