From 42940b175df8a083e0436a9795fd4780afbb7fb2 Mon Sep 17 00:00:00 2001 From: Alexandre Decan Date: Thu, 9 Feb 2023 17:00:01 +0100 Subject: [PATCH] Doc --- CHANGELOG.md | 11 +++++------ tests/test_const.py | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 072ec2b..0785e06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,13 @@ ## 2.4.0 (not yet released) -### Added -- `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` used to create `Interval` instances (default is `Interval`). - ### Changed - Speed up `repr` and `to_string` for `Interval` instances (see [#76](https://github.com/AlexandreDecan/portion/issues/76), adm271828). - - `IntervalDict` uses `self.__class__` to preserve subclasses when creating new instances. + - 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`). + * (Internal) Add a `klass` parameter for `open`, `closed`, `openclosed`, `closedopen`, `singleton` and `empty` (default is `Interval`). + * (Experimental) 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. diff --git a/tests/test_const.py b/tests/test_const.py index a5ad083..a41a042 100644 --- a/tests/test_const.py +++ b/tests/test_const.py @@ -1,7 +1,7 @@ import pytest -from portion.const import inf, _PInf, _NInf, Bound -from portion import CLOSED, OPEN +from portion.const import _PInf, _NInf, Bound +from portion import inf, CLOSED, OPEN class TestBounds: