What is the convention for naming interfaces and abstract classes in Python? PEP 8 doesn’t discuss this. For example, in Java, interfaces are often named with an I prefix. In PHP (prior to namespaces), abstract classes are typically named with an _Abstract suffix.
(I realize that Pythonists are not keen on interfaces, and perhaps this is the reason why I can’t find much consensus on this topic. But the usage of interfaces and abstract classes is not my question.)
I think naming an interface with an
Iprefix is perfectly acceptable.e.g.:
IFooIPublishableA few years back I used Zope Interfaces. I noticed most codebases used this convention. Our team did too.
We preferred
IFoovs.FooInterfaceorIFooInterface