On 11/22/06, Bill Janssen <[EMAIL PROTECTED]> wrote:
> 2)  But also, if Python was built with interfaces, "special" methods
> would each be in their own namespace.  That is, a user wouldn't have
> to worry about accidentally overriding a method; they'd have to
> explicitly override the "len" method inherited from the "container"
> interface; just defining a method called "len" in their subclass
> wouldn't do it.  CLOS is rather elegant in this respect.

Ow, that's the first time you describe this particular wrinkle. I
don't know anything by CLOS. Python has a rather much simpler approach
to attribute namespaces for class instances; you can have only one
attribute named "len" (since it's contained within a class, most folks
consider this sufficient localization to not have to worry about
conflicts). I don't think that anyone else here thought of ABCs or
interfaces introducing separate namespaces yet. The __special__
namespace is effectively a second namespace, orthogonal to the regular
namespace, because there's an explicit convention that you shouldn't
define __special__ attributes unless you are implementing whatever
semantics a particular __special__ name has.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to