[Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().
Alexander Belopolsky
alexander.belopolsky at gmail.com
Tue Oct 15 20:17:15 CEST 2013
More information about the Python-Dev mailing list
Tue Oct 15 20:17:15 CEST 2013
- Previous message: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().
- Next message: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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() ?
- Previous message: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().
- Next message: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list