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.3.tar.gz (104.0 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pygeneric-0.5.3.tar.gz
Algorithm Hash digest
SHA256 a69aa12c23b725ef0104683f8020cfa7eb8857978633e45460b6f44c9c54d479
MD5 a77c2da1c5b0279a6c7a881bd48034f8
BLAKE2b-256 c81d04c6e5dfd9175811aa4b9682ab8ae3107bba4a45e3967c45f6cab381ad79

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