Portion

Latest version: v2.6.0

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

Scan your dependencies

Page 2 of 7

2.3.0

Added
- Support for Python 3.10.
- `IntervalDict.as_dict` has an optional `atomic=False` parameter that, if set to `True`, returns intervals that are atomic.
- Experimental support for structural pattern matching (on `left`, `lower`, `upper` and `right`).

Fixed
- (breaking) Set `list(P.empty()) == []`, i.e., the empty interval is a disjunction of no interval (see [72](https://github.com/AlexandreDecan/portion/issues/72)).
- (breaking) For consistency, the empty interval is never `<`, `>`, `<=`, nor `>=` when compared to another interval.
- Comparing an interval and a value is deprecated since it is ill-defined when the value is on the left of `<=` or `>=`. Convert values to singletons first.

2.2.0

Added
- Support [PEP 517](https://www.python.org/dev/peps/pep-0517).

Changed
- Some internal changes to ease subclassing `Interval`(see [58](https://github.com/AlexandreDecan/portion/issues/58)):
* Use `self.__class__` instead of `Interval` to create new instances;
* Deprecate and move `mergeable` function to `Interval._mergeable` class method;
* `Interval.from_atomic` is now a class method instead of a static method.
- Speed up lookups in `IntervalDict` ([65](https://github.com/AlexandreDecan/portion/issues/65), Jeff Trull).
- Speed up removals in `IntervalDict`.
- Speed up intersection for non-overlapping intervals ([66](https://github.com/AlexandreDecan/portion/issues/66), Jeff Trull).
- Speed up `.overlaps` and `.contains` for non-overlapping intervals/items.

2.1.6

Changed
- Drop official support for Python 3.5.
- Use `black` as official code formatting.

Fixed
- `from_string`raises a `ValueError` if given string cannot be parsed to an interval ([57](https://github.com/AlexandreDecan/portion/issues/57)).

2.1.5

Fixed
- Getting items from an `Interval` using a slice does no longer return a `list` but an `Interval` instance.
- Intervals are properly pretty-printed by `pandas` ([54](https://github.com/AlexandreDecan/portion/pull/54)).

2.1.4

Changed
- Much faster `get`, `copy` and `|` operations for `IntervalDict`.

2.1.3

Fixed
- Empty intervals are contained in all intervals ([41](https://github.com/AlexandreDecan/portion/issues/41)).

Page 2 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.