Creating an interface and swappable implementations in python

Posted by Blankman on Stack Overflow See other posts from Stack Overflow or by Blankman
Published on 2010-05-18T18:50:56Z Indexed on 2010/05/18 19:00 UTC
Read the original article Hit count: 209

Filed under:
|
|

Hi,

Would it be possible to create a class interface in python and various implementations of the interface.

Example: I want to create a class for pop3 access (and all methods etc.). If I go with a commercial component, I want to wrap it to adhere to a contract.

In the future, if I want to use another component or code my own, I want to be able to swap things out and not have things very tightly coupled.

Possible? I'm new to python.

© Stack Overflow or respective owner

Related posts about python

Related posts about best-practices