[Python-3000] Abilities / Interfaces

Gustavo Niemeyer gustavo at niemeyer.net
Thu Nov 23 14:20:22 CET 2006


> IMO the difference between ABCs and interfaces/abilities is that
> inserting a new ABC into an existing class hierarchy without modifying
> its source code is considered a hack, and must be done by a helper
> routine that *actually* mucks with __bases__; while (Zope-style)
> interfaces use an external registry or a separate class attribute
> (__implements__) that is intended to be mucked with.

Right.  That and also being able to assign interfaces to individual
instances, being able to split and merge interfaces in a level that
doesn't need changing the implementation itself, and so on.

-- 
Gustavo Niemeyer
http://niemeyer.net


More information about the Python-3000 mailing list