3 ms·Top Python Functions I Wish I Knew Earlier2 points by rbanffy 7y agoeesmith 7y agoI find I use getattr(obj, "name", default) much more than hasattr(). exec() is a security hole, or nasty bug, just waiting to happen.