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.
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
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
pygeneric-0.5.4.tar.gz
(104.1 kB
view details)
File details
Details for the file pygeneric-0.5.4.tar.gz
.
File metadata
- Download URL: pygeneric-0.5.4.tar.gz
- Upload date:
- Size: 104.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56cb6a5861c25920e9280fd1cb0c0b8f59540d98f278b720c89d6b238d4cfa3c |
|
MD5 | 6fe1a7a628815213a6868e3eedc9de2d |
|
BLAKE2b-256 | ffd1f8d4038a7fc4fe59c93d6e20a1be67c084ae08177a3d67e4d91224422574 |