Portion

Latest version: v2.4.2

Safety actively analyzes 631215 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 6

1.8.0

Added
- Intervals have a `.left`, `.lower`, `.upper`, and `.right` attribute that refer to its enclosure.
- Intervals have a `.replace` method to create new intervals based on the current one. This method accepts both values and functions.
- Intervals have an `.apply` method to apply a function on the underlying atomic intervals.
- Intervals can be compared with single values as well.

Changed
- `P.empty()` returns the same instance to save memory.
- Infinities are singleton objects.
- Set `len(P.empty()) = 1` and `P.empty()[0] == P.empty().to_atomic()` for consistency.

1.7.0

Added
- Import from and export to Python built-in data types (a list of 4-uples) with `from_data` and `to_data` ([6](https://github.com/AlexandreDecan/portion/issues/6)).
- Examples for arbitrary interval transformations.

1.6.0

Added
- Support for customized infinity representation in `to_string` and `from_string` ([3](https://github.com/AlexandreDecan/portion/issues/3)).

1.5.4

Fixed
- `.overlaps` ([2](https://github.com/AlexandreDecan/portion/issues/2)).

1.5.3

Fixed
- Invalid `repr` for atomic singleton intervals.

1.5.2

Fixed
- Invalid comparisons when both `Interval` and `AtomicInterval` are compared.

Page 4 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.