Chris Angelico <ros...@gmail.com>:

> On Tue, Feb 3, 2015 at 9:38 PM, Marko Rauhamaa <ma...@pacujo.net> wrote:
>> It's slightly sad that Python exposes the two-level attribute lookup.
>> It would be more elegant if, conceptually, all methods were retrieved
>> from the object's attribute dict. That way, the class would be simply
>> a mundane optimization trick instead of a metaphysical entity.
>
> That's the ECMAScript model of classes - prototype-based. It's not
> Python's. There are many different ways to do things.

For (almost) all practical purposes, that is the Python way as well. If
object instantiation (conceptually) copied the class's methods into the
object's dict, you'd get the semantics I'm looking for.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to