Skip to main content

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


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 details)

Uploaded Source

File details

Details for the file PyCLOS-0.2.tar.gz.

File metadata

  • Download URL: PyCLOS-0.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyCLOS-0.2.tar.gz
Algorithm Hash digest
SHA256 1b975979a3f463649a162c4de657d513b7e2cebf11090ae2506d86563e58f705
MD5 ca4b6a5ce72bddccc17d202c07ea1846
BLAKE2b-256 25a2f8c93367616cb328a8642ac14fbda2cd9ae555490273164d94aba06c47c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page