On Jan 12, 2014 5:52 AM, "Yury Selivanov" <yselivanov.ml@gmail.com> wrote:
> BTW, ABC proposal aside: the current namedtuple implementation
> creates the class from a template with "exec" call. For every namedtuple,
> it's entire set of methods is created over and over again. Even for the
> memory efficiency sake, having a base class with *some* of the common
> methods (which are currently in the template) is better.

It's a trade-off.  We increase the definition-time cost by using exec, but minimize the cost of traversing the attribute lookup chain when using instances.  The purely ABC approach in the referenced issue preserves this instance-favoring-optimization design.

-eric