Portion

Latest version: v2.6.0

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

Scan your dependencies

Page 1 of 7

2.6.0

Added
- The `how` function of `combine` can access the current interval if `pass_interval` is set (see [97](https://github.com/AlexandreDecan/portion/issues/97)).

2.5.0

Added
- The `combine` method of an `IntervalDict` accepts a `missing` parameter to fill values for non-overlapping keys (see [96](https://github.com/AlexandreDecan/portion/issues/96)).
- A recipe to `combine` more than two `IntervalDict` (see [95](https://github.com/AlexandreDecan/portion/issues/95#issuecomment-2351435891)).

Changed
- Drop official support for Python 3.7.

2.4.2

Fixed
- Import error when using `create_api` in Python 3.10+ (see [87](https://github.com/AlexandreDecan/portion/issues/87)).

2.4.1

Fixed
- Import error when using `create_api` outside a REPL (see [85](https://github.com/AlexandreDecan/portion/issues/85)).

2.4.0

Added
- An `AbstractDiscreteInterval` class to ease the creation of specialized discrete intervals (experimental).
- A `create_api` function to generate an API similar to the one of `portion` but configured to use a given subclass of `Interval` (experimental, see [Specialize & customize intervals](https://github.com/AlexandreDecan/portion#specialize--customize-intervals)).

Changed
- Speed up `repr` and `to_string` for `Interval` instances (see [76](https://github.com/AlexandreDecan/portion/issues/76), adm271828).
- Some internal changes to ease subclassing:
* `from_string` and `from_data` accepts a `klass` parameter to specify which class should be used to create `Interval` instances (default is `Interval`).
* Add a `klass` parameter for `open`, `closed`, `openclosed`, `closedopen`, `singleton` and `empty` (default is `Interval`).
* Add a `_klass` class attribute in `IntervalDict` to specify how to create `Interval` instances (default is `Interval`).
* `IntervalDict` uses `self.__class__` to preserve subclasses when creating new instances.

2.3.1

Changed
- Speed up lookups in `IntervalDict` for non-interval keys.
- Speed up `iterate` by no longer creating singleton instances under the hood.
- Drop official support for Python 3.6.

Fixed
- Infinite recursion when a subclass of an `Interval` is compared using `>` with an `Interval` instance (see [75](https://github.com/AlexandreDecan/portion/issues/75)).

Page 1 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.