Feb. 22, 2014
3:52 p.m.
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[1], but it did help swing me to positive on this PEP. Footnotes: [1] If it were, somebody would have reimplemented haveattr to avoid generating an exception.