Bringing interfaces to Python.
Project description
python-interface
Installation
pip install python-interface
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-interface.git && cd python-interface
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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0941d5bd74f4674a6a6f0c519e45fb4e4010facb0d6891f51e7a25d85742f7b6 |
|
MD5 | e92229afb9f399923014b7da6c918898 |
|
BLAKE2b-256 | c19eb6f00703b94487553bac1a58da549c80a7be6ce515b84ecd344bb579808a |