Bringing interfaces to Python.
Project description
python-interfaces
Installation
pip install python-interfaces
Usage
from interface import interface
class Iterable:
def be_iterable(self):
pass
@interface(Iterable)
class Foo:
def __init__(self):
pass
# raises InterfaceException
Local Development
git clone https://github.com/tyleragreen/python-interfaces.git && cd python-interfaces
virtualenv ~/.env/interface
source ~/.env/interface/bin/activate
pip install -r requirements_dev.txt
# Since the tests live outside the package, we install the package in editable mode
pip install -e .
py.test
Other Ideas
- Support dunder methods
- Enforce method signatures
- Require interface methods to be empty/abstract/
pass
-only
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for python_interfaces-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61d2ffdecaff2ffd7166b654bb6ee667823fe4008dee6d23a19d4d5a51242e2e |
|
MD5 | 0eac8afd8d13f89c4d0b0fc27dced186 |
|
BLAKE2b-256 | 671462c06ba8b8c33e23f361ff28cbe95bf1ea960f8c69fa4edf643c74947bb8 |