Why PEP 245??

nanotech at europa.com nanotech at europa.com
Wed May 30 00:20:32 CEST 2001


All:

Could someone explain to me what in PEP 245 would be new to Python in 
terms of functionality? I did read it, but must not have understood 
it! :)

According to the PEP:

    The purpose of an interface is to document how
    to work with an object, not how the object is
    implemented.

If this is all (or a large part), then why not just doc-strings? With 
pydoc documentation is now nicely done.

Basically, without some sort of "compile-time" check that classes 
that use interfaces use them correctly or classes that expect other 
classes are using an interface are actually doing so, what is the 
benefit:

    Interfaces try to solve these problems by
    providing a way for you to specify a
    contractual obligation for your object....

But what enforces the contract?

  Quentin Crain

PS: Where do mixin classes fit? Or have they gone out of style?






More information about the Python-list mailing list