22 Feb
2014
22 Feb
'14
11:44 a.m.
On Sat, Feb 22, 2014 at 10:27 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
Yeah, none of these examples makes a convincing case that hasattr() is useless, IMO.
I'm not trying to make the case that it's useless. I'm trying to show that, if it didn't exist, all of these would be written some other way, and the case for its creation would not be terribly strong. It's definitely of value (and as you've shown in some of those cases, its proper use can narrow the exception-catching scope - a good thing), but not enough to be worth blessing with a built-in function. ChrisA