[Python-Dev] PEP 463: Exception-catching expressions
Stephen J. Turnbull
stephen at xemacs.org
Sun Feb 23 00:52:20 CET 2014
Antoine Pitrou writes:
> Sure, but complaining about inefficiencies without asserting their
> significance is not very useful.
Since you completely missed the point of my post, I'll explain. I was
in no way complaining about inefficiencies.
My point was precisely the opposite: to the extent that most 'get'
methods would be implemented in Python, even the minor inefficiency of
creating and suppressing a useless exception can't be avoided with the
LBYL of a get method, because haveattr itself is implemented by
generating and suppressing an exception.
I know that it's not a big deal, but it did help swing me to
positive on this PEP.
 If it were, somebody would have reimplemented haveattr to avoid
generating an exception.
More information about the Python-Dev