Convtools

Latest version: v1.14.3

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

Scan your dependencies

Page 8 of 18

0.32.0

**Features**

- introduced ``c.iter_windows(width=7, step=1)`` / ``(...).iter_windows(...)``
conversions, which iterate through an iterable and yield windows as tuples

0.31.0

**Experimental - contrib.models**

- added Enum validator, e.g. ``validators.Enum(UserDefinedEnum)`` to check
whether an object is a valid value of a provided Enum subclass

0.30.0

**Experimental - contrib.models**

- added length validator, e.g. ``validators.Length(min_length=1, max_length=2)``

0.29.0

- updated ``DictArray``, ``DictSum``, ``DictSumOrNone`` so they don't rebuild
dicts from defaultdicts (only setting default_factory to None, so
defaultdicts start raising KeyErrors like regular dicts)
- changed ``c.naive`` conversion logic so it supports pre-warming its value by
putting it as a function parameter with a default value (conversions are not
obliged to use naive pre-warming; if they don't request it, they will deal
with global lookups to ``__naive_values__`` dict)

**Experimental - contrib.models**

- updated casters to support expression-mode, where they can be used as a part
of list/set/dict/tuple comprehension (instead of building these collections
in a loop in simple cases)
- sped up models
- inlined ``validators.Required``

0.28.0

**Experimental - contrib.models**

- added ``typing.Set`` support
- added ``X | Y`` type support (PEP 604 - Python 3.10+)
- added ``list[int]``-like type definition support (Python 3.9+)

0.27.0

**Experimental - contrib.models**

- added ``a: bool = cast()`` support
- added ``typing.Literal`` support

Page 8 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.