CLOS-style generic functions with annotation based syntax
Project description
PyCLOS implements CLOS-style generic functions for Python 3. Current implementation is pure python with optional dependency on C implemented lru-dict which gets used for dispatch caches in case of specialization on value.
Example usage:
from py_clos import generic @generic def display(what, where): return "{} on {}".format(what, where) @generic.around def display(what, where: Webpage, next_method): return "<html>{}</html>".format(next_method(what, where)) @generic def display(what: User, where): return "user"
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
PyCLOS-0.2.tar.gz
(5.4 kB
view hashes)