Decorator that adds math dunders to a class derived from a numeric type.
Project description
mathdunders provides a Python 3 decorator that automatically adds 23 math-related dunder methods to a class derived from a numeric type.
Installation:
pip install mathdunders
Usage:
from mathdunders import mathdunders
@mathdunders() class RealNumber(float): pass
x = RealNumber(1) + RealNumber(2) print(x, type(x)) # -> 3 <class 'main.RealNumber'>
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for mathdunders-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69bb29cafe416ecbe2dfb9fa197bd2e595a9fd841f38ff9249874c390852cfab |
|
MD5 | b3ca7f5cf0427325d60cd60bd43bbe4d |
|
BLAKE2b-256 | b77098b0c94d56d5aec3f1f1b1084e536fdc0e607b212ce4a9252981edd0831b |