Hypothesis

Latest version: v6.100.1

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

Scan your dependencies

Page 141 of 195

3.68.0

Not secure
-------------------

:func:`~hypothesis.extra.numpy.arrays` now checks that integer and float
values drawn from ``elements`` and ``fill`` strategies can be safely cast
to the dtype of the array, and emits a warning otherwise (:issue:`1385`).

Elements in the resulting array could previously violate constraints on
the elements strategy due to floating-point overflow or truncation of
integers to fit smaller types.

3.67.1

Not secure
-------------------

This release contains a tiny refactoring of the internals.
There is no user-visible change.

3.67.0

Not secure
-------------------

This release adds a ``width`` argument to :func:`~hypothesis.strategies.floats`,
to generate lower-precision floating point numbers for e.g. Numpy arrays.

The generated examples are always instances of Python's native ``float``
type, which is 64bit, but passing ``width=32`` will ensure that all values
can be exactly represented as 32bit floats. This can be useful to avoid
overflow (to +/- infinity), and for efficiency of generation and shrinking.

Half-precision floats (``width=16``) are also supported, but require Numpy
if you are running Python 3.5 or earlier.

3.66.33

Not secure
--------------------

This release fixes a bug in :func:`~hypothesis.strategies.floats`, where
setting ``allow_infinity=False`` and exactly one of ``min_value`` and
``max_value`` would allow infinite values to be generated.

3.66.32

Not secure
--------------------

This release adds type hints to the :obj:`example() <hypothesis.example>` and
:func:`~hypothesis.seed` decorators, and fixes the type hint on
:func:`~hypothesis.strategies.register_type_strategy`. The second argument to
:func:`~hypothesis.strategies.register_type_strategy` must either be a
``SearchStrategy``, or a callable which takes a ``type`` and returns a
``SearchStrategy``.

3.66.31

Not secure
--------------------

Another set of changes designed to improve the performance of shrinking on
large examples. In particular the shrinker should now spend considerably less
time running useless shrinks.

Page 141 of 195

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.