ISpec - Interface Specification

Warning

ISpec is an experimental project, and is not aimed to be used in real projects. You can successfully create interfaces with the help of abc (on which ispec is based), zope.interface, and last but not least, the best solution, the Protocol from typing.

ISpec is a project aimed to create a simple way of defining interfaces. What it does is use the abc module, make your class inherit abc.ABC, apply the abc.abstractmethod decorator, and ensure the function signature uses type hints for parameters and returns. With this, a class that implements an ISpec interface can’t be instantiated if it doesn’t define every function of the interface, and the interface must declare type hints to improve readability.

Getting started

Indices and tables