Fewer hasattr(), isinstance() calls.
Fewer hasattr(), isinstance() calls.

Reliance on hasattr() or isinstance() is generally considered
undesirable; an object should be evaluated in terms of *what needs to be
done with it*, not in terms of what it can do, or what it is. I'm still
not sure how to remove the remaining isinstance() calls, though.

Some more reduce() calls added, also.

AdeebNqo/greenery,ferno/greenery,ThomsonReuters-LSPS/greenery