I am try to implement a interface in python with the module “overloading”
http://www.python.org/dev/peps/pep-3124/#interfaces-and-adaptation
The problem is that no found the module overloading when a try to run with python3.2
from overloading import abstract
from overloading import Interface
ImportError: No module named overloading
how to fix my problem?.
A PEP is a Python Enhancement Proposal. Not all PEPs are accepted. Due to some uncertainties about implementation, the author of PEP 3124 decided to defer the proposal. However, note that this was in 2007 with no progress since then, so I wouldn’t hold my breath waiting for this one.
If you’re after a mechanism for interface checking, you might be able to use the
abcmodule in the standard library, which roughly covers the same interface & adaptation ground that PEP 3124 proposed.For a more full featured solution, I highly recommend
zope.interface. If you’re put off by the zope namespace (you shouldn’t be, it’s totally independent) there are other lightweight interface solutions such asvisage.