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 Distributions

pygeneric-0.5.1.zip (119.1 kB view details)

Uploaded Source

pygeneric-0.5.1.tar.gz (101.5 kB view details)

Uploaded Source

File details

Details for the file pygeneric-0.5.1.zip.

File metadata

  • Download URL: pygeneric-0.5.1.zip
  • Upload date:
  • Size: 119.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygeneric-0.5.1.zip
Algorithm Hash digest
SHA256 ac5ce08e650c1da8553af448933d64c6cce27d17ffe23d08de1c56774b887912
MD5 1493e2e2753a5ae48d5e35b72086a9eb
BLAKE2b-256 ea0c282950de059c82b600eff05d04738fbf835f29fbd3e9eb242c7ca5901f94

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pygeneric-0.5.1.tar.gz
Algorithm Hash digest
SHA256 5e899777a29835feae663398aa15f54660958beb3820ab5e43a441ac32d9a718
MD5 5a9828c8ae589cc408fd42af065a3149
BLAKE2b-256 c7cafc492536048633279f0605fae2ac8cb634afcf76ce59b4590dff6b7fca7a

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