Fields

Latest version: v5.0.0

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

Scan your dependencies

Page 1 of 3

5.0.0

------------------

* Added the ``fields.InheritableFields`` base. It allows subclassing and it's intended for multiple inheritance scenarios. Yes,
yes, this enables lots pain and suffering, but some people just like it that way.
* Simplified the interfaces for the builtin sealers (the required argument is gone as it was redundant, and the remaining
arguments are swapped). Now they must be a function that take just two arguments: ``fields, defaults``.

4.0.0

------------------

* Added ``__all__`` and ``factory`` conveniences. Removed :obj:`fields.Factory` from the public API since it need some special
care with it's use (it's a damn metaclass after all).
* Added ``make_init_func`` into public API for advanced uses (combine with ``factory`` and ``class_sealer``).

3.0.0

------------------

* Disallowed creating containers with fields with "dunder" names. E.g.: ``class Foo(Fields.__foo__):`` is disallowed.

2.4.0

------------------

* Similarly to ``fields.Fields``, added three new bases:

* ``fields.BareFields`` (implements ``__init__``).
* ``fields.ComparableMixin`` (implements ``__eq__``, ``__ne__``, ``__lt__``, ``__gt__``, ``__le__``, ``__ge__`` and ``__hash__``).
* ``fields.PrintableMixin`` (implements ``__repr__``).

* Improved reference section in the docs.
* Added ``fields.ConvertibleFields`` and ``fields.ConvertibleMixin``. They have two convenience properties: ``as_dict`` and `as_tuple``.

2.3.0

------------------

* Allowed overriding ``__slots__`` in ``SlotsFields`` subclasses.

2.2.0

------------------

* Added ``make_init_func`` as an optional argument to ``class_sealer``. Rename the ``__base__`` option to just ``base``.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.