Missing interfaces in Python...

bruno at modulix onurb at xiludom.gro
Wed Apr 19 04:38:40 EDT 2006


olsongt at verizon.net wrote:
(snip)

> Everyone is getting off track here.

Not that much...

> Java has interfaces because it doesn't support multiple inheritance.

Java as interfaces because it relies on type declaration for subtyping
*and* doesn't support MI.

> Python supports MI, so you don't need to use the seperate concept of an
> interface.  

s/supports MI/doesn't rely on type declaration for subtyping/

Would we need interfaces in Python if Python did not support MI ? Of
course not, duck typing would still work.

(snip)


> The general wisdom is that Abstract Base Classes aren't pythonic
> though.  

*Pure* abstract base classes (ie: abc without any implementation) are
not Pythonic. I often use abc's that provides the 'guts' for common
stuff, but are meant to be specialized for use (this is pretty common in
frameworks).

(snip the rest - mostly agree)

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list