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

2013年10月15日 09:30:47 -0700

On Tue, Oct 15, 2013 at 11:52 AM, R. David Murray <[email protected]> wrote:
> I think 'trap' would be much clearer.
+1. Short and sweet, and just ambiguous enough that you don't leap to
the conclusion that the error is ignored. I agree that "suppress" is
basically a synonym for "ignore"; trap at least *implies* some kind of
control flow change, which is what's needed to prevent misconceptions.
Personally, I would rate "catch" higher than "trap" because it further
implies that it is catching a thrown exception, but would compromise
to "trap" if that'll end the thread sooner. ;-)
> What about making the context
> manager provide the trapped exception, in a fashion similar to
> what assertRaises does?
Sadly, that won't work, since context managers provide a value
*before* the block is executed, not after.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to