Skip to content

0.4.0

Compare
Choose a tag to compare
@antonagestam antonagestam released this 09 Oct 19:56
· 55 commits to main since this release
9131e75

What's Changed

⚠️ Note! There are multiple breaking changes in this release.

Overdraft can no longer have value=0

In order to make Overdraft disjoint with the Money type, and make sure there is a single answer to the question "how is zero money represented?", the Overdraft type has been updated to give an error for such instantiations. With this same change, Overdraft was also updated to carry its own value and currency, these are now accessed through the .subunits and .currency attributes. The .money attribute has been removed.

Decimal is replaced with int

This means that Money and Overdraft no longer has an internal Decimal value, but instead carries a .subunits integer attribute. An ad-hoc Decimal can be constructed through the .decimal property on both types.

Swap __truediv__ and __floordiv__

The implementations of / and // have swapped places for Money, which means SEK(1) / 1 now returns a SubunitFraction instead of a tuple of Money instances.

Full Changelog: 0.3.1...0.4.0