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

2013年10月16日 05:03:37 -0700

2013年10月16日 Antoine Pitrou <[email protected]>:
>> By the way, what are the performances of contextlib.ignore()?
>> Exceptions can be slow in some cases. Adding something even slower
>> would not be a good idea.
>
> A "try" block which succeeds is fast.
Ah yes, I never reminder this fact. I try to not care too much of
micro-optimizations :-)
> A context manager will always be
> slower, especially when written in pure Python with a generator wrapped
> in a contextlib.contextmanager.
ignore() is much slower than try/except even if the block succeeds?
Victor
_______________________________________________
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