normedtuple
Introduction

This project allows for creating normed tuple classes.

Installation
Implementation
from normedtuple import normedtuple  

@normedtuple
def Point(cls, x: float, y: float) -> tuple[float, float]:
    "2D point with automatic rounding."
    return round(x, 2), round(y, 2)

p = Point(3.14159, 2.71828)
print(p)        # Output: (3.14, 2.72)
print(type(p))  # Output: <class '__main__.Point'>
Testing
License
Impressum