Why PEP 245??

nanotech at europa.com nanotech at europa.com
Tue May 29 18:20:32 EDT 2001


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

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 

    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