|
1 | 1 | # Changelog |
2 | 2 |
|
3 | | -### 0.2.1 - bugfix |
| 3 | +### 0.5.0 - First public version |
4 | 4 |
|
5 | | -Fixed [#4](https://github.com/smarie/python-pyfields/issues/4). |
| 5 | +**fields** |
6 | 6 |
|
7 | | -### 0.2.0 - `field` improvements |
| 7 | + - `field()` method to easily define class fields without necessarily defining a `__init__`. |
| 8 | + |
| 9 | + - "native" fields are created by default, or if `native=True` is set. A `NativeField` is a non-data descriptor that replaces itself automatically with a native python attribute after the first read, to get the same performance level on later access. |
| 10 | + |
| 11 | + - "descriptor" fields are created when type or value validation is required, or if `native=False` is set. A `DescriptorField` uses the standard python descriptor protocol so that type and value can be validated on all future access without messing with the `__setattr__` method. |
| 12 | + |
| 13 | + - support for `type_hint` declaration to declare the type of a field. If `validate_type` provided, the descriptor will *not* be replaced with a native field, and the type will be checked on every value modification. A `TypeError` will be raised if type does not comply. Type hints are correctly defined so that IDEs can pick them. Fixes [#10](https://github.com/smarie/python-pyfields/issues/10) |
| 14 | + |
| 15 | + - support for `validators` relying on `valid8`. Validators can receive `(val)`, `(obj, val)` or `(obj, field, val)` to support validation based on several fields. The only requirement is to return `True` or `None` in case of success. Fixes [#3](https://github.com/smarie/python-pyfields/issues/3) |
8 | 16 |
|
9 | | - - New `type` argument in `field` to declare the type of a field. If provided, the descriptor will *not* be replaced with a native field, and the type will be checked on every value modification. A `TypeError` will be raised if type does not comply. Type hints are correctly defined so that IDEs can pick them. Fixes [#3](https://github.com/smarie/python-pyfields/issues/3) |
| 17 | +**init** |
10 | 18 |
|
11 | | - - New `use_descriptor` argument in `field` to force use a descriptor instead of a native field. |
| 19 | + - `make_init` method to create an entire `__init__` method with control of which fields are injected, and with possibility to blend a post-init callback in. Fixes [#14](https://github.com/smarie/python-pyfields/issues/14). |
12 | 20 |
|
13 | | -### 0.1.0 - First public version |
| 21 | + - `@init_fields` decorator to auto-init fields before your `__init__` method. |
14 | 22 |
|
15 | | -**Mix-in basics**: |
| 23 | + - `@inject_fields` decorator to easily inject `fields` in an init method and perform the assignment precisely when users want (for easy debugging). Fixes [#13](https://github.com/smarie/python-pyfields/issues/13) |
16 | 24 |
|
17 | | - - `field` class to easily define class fields in a mixin without defining a `__init__`. |
18 | | - - `@apply_mixins` decorator to apply mixins to a class without inheritance, by copying members (="monkeypatching") |
19 | | - - Light documentation |
20 | | - |
| 25 | +**misc** |
| 26 | + |
| 27 | + - `__weakref__` added in all relevant classes. Fixes [#21](https://github.com/smarie/python-pyfields/issues/21) |
| 28 | + |
| 29 | + - Now using stubs [#17](https://github.com/smarie/python-pyfields/issues/17) |
| 30 | + |
| 31 | + - Fixed bug [#11](https://github.com/smarie/python-pyfields/issues/11). |
| 32 | + |
| 33 | + - Fixed `ValueError` with mini-lambda < 2.2. Fixed [#22](https://github.com/smarie/python-pyfields/issues/22) |
| 34 | + |
| 35 | + - Because of a [limitation in PyCharm type hints](https://youtrack.jetbrains.com/issue/PY-38151) we had to remove support for class-level field access. This created [#12](https://github.com/smarie/python-pyfields/issues/12) which will be fixed as soon as PyCharm issue is fixed. |
| 36 | + |
| 37 | +### 0.1.0 - unpublished first draft |
| 38 | + |
| 39 | +Extracted from [`mixture`](https://smarie.github.io/python-mixture/). |
0 commit comments