Skip to main content

Generic functions for Python

Project description

`pygeneric` implements generic functions with type dispatch in Python. A generic
function groups different implementations (or methods) under the same name.
The actual implementation is then chosen at runtime depending on the function
arguments.

The implementation is loosely inspired in the Julia language. We also shamelessly
steal some other features of Julia and adapted them to Python:
* Parametric types.
* A type conversion/promotion system integrated with arithmetic operations.
* A generic Object base class that delegates all binary operations to the
corresponding generic functions (i.e., instead of implementing
Object.__add__, we overload add(Object, Object)).

This package works with Python 3 and Python 2, but it is getting increasingly
more difficult to keep Python 2 support as we implement more advanced features.
We would love to let it go of Python 2, so please tell us if you use this package
in Python 2.

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

pygeneric-0.5.2.tar.gz (101.9 kB view details)

Uploaded Source

File details

Details for the file pygeneric-0.5.2.tar.gz.

File metadata

  • Download URL: pygeneric-0.5.2.tar.gz
  • Upload date:
  • Size: 101.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygeneric-0.5.2.tar.gz
Algorithm Hash digest
SHA256 c3e812614e7f77339ebb8d8b6229eac6892b8fe52217f96a3419a832fec5a0df
MD5 bc467aa70cb33d4c4bcbe0cb7cb75d18
BLAKE2b-256 882754adbab725f75d89ab43e43cb9a937092f7d77b06eb9685064ce192ae9d5

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