On Tue, 15 May 2018, 23:15 Tobiah, <t...@tobiah.org> wrote:

Why is it getattr(object, item) rather then object.getattr(item)?

It's part of the design philosophy of Python that the
namespace of a new user-defined class should as far as
possible start off as a "blank slate", not cluttered
up with a bunch of predefined names. So, very general
things like getattr() that apply to any object are
implemented as functions that operate on an object,
rather than methods.


Reply via email to