Btrees

Latest version: v6.1

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

Scan your dependencies

Page 3 of 8

4.9.2

==================

- Fix ``fsBTree.TreeSet`` and ``fsBTree.BTree`` raising
``SystemError``. See `issue 170 <https://github.com/zopefoundation/BTrees/issues/170>`_.

- Fix all the ``fsBTree`` objects to provide the correct interfaces
and be instances of the appropriate collection ABCs. This was done
for the other modules in release 4.8.0.

- Fix the ``multiunion``, ``union``, ``intersection``, and
``difference`` functions when used with arbitrary iterables.
Previously, the iterable had to be pre-sorted, meaning only
sequences like ``list`` and ``tuple`` could reliably be used; this
was not documented though. If the iterable wasn't sorted, the
function would produce garbage output. Now, if the function detects
an arbitrary iterable, it automatically sorts a copy.

4.9.1

==================

- Fix setting unknown class attributes on subclasses of BTrees when
using the C extension. This prevented subclasses from being
decorated with ``component.adapter()``. See `issue 168
<https://github.com/zopefoundation/BTrees/issues/168>`_.

4.9.0

==================

- Fix the C implementation to match the Python implementation and
allow setting custom node sizes for an entire application directly
by changing ``BTree.max_leaf_size`` and ``BTree.max_internal_size``
attributes, without having to create a new subclass. These
attributes can now also be read from the classes in the C
implementation. See `issue 166
<https://github.com/zopefoundation/BTrees/issues/166>`_.

- Add various small performance improvements for storing
zope.interface attributes on ``BTree`` and ``TreeSet`` as well as
deactivating persistent objects from this package.

4.8.0

==================

- Make Python 2 forbid the use of type objects as keys (unless a
custom metaclass is used that implements comparison as required by
BTrees.) On Python 3, types are not orderable so they were already
forbidden, but on Python 2 types can be ordered by memory address,
which makes them unsuitable for use as keys. See `issue
<https://github.com/zopefoundation/BTrees/issues/153>`_.

- Make the ``multiunion``, ``union``, ``intersection``, and
``difference`` functions accept arbitrary Python iterables (that
iterate across the correct types). Previously, the Python
implementation allowed this, but the C implementation only allowed
objects (like ``TreeSet`` or ``Bucket``) defined in the same module
providing the function. See `issue 24
<https://github.com/zopefoundation/BTrees/issues/24>`_.

- Fix persistency bug in the Python version
(`118 <https://github.com/zopefoundation/BTrees/issues/118>`_).

- Fix ``Tree.__setstate__`` to no longer accept children besides
tree or bucket types to prevent crashes. See `PR 143
<https://github.com/zopefoundation/BTrees/pull/143>`_ for details.

- Make BTrees, TreeSet, Set and Buckets implements the ``__and__``,
``__or__`` and ``__sub__`` special methods as shortcuts for
``BTrees.Interfaces.IMerge.intersection``,
``BTrees.Interfaces.IMerge.union`` and
``BTrees.Interfaces.IMerge.difference``.

- Add support for Python 3.9.

- Build and upload aarch64 wheels.

- Make a value of ``0`` in the ``PURE_PYTHON`` environment variable
require the C extensions (except on PyPy). Previously, and if this
variable is unset, missing or unusable C extensions would be
silently ignored. With this variable set to ``0``, an
``ImportError`` will be raised if the C extensions are unavailable.
See `issue 156
<https://github.com/zopefoundation/BTrees/issues/156>`_.

- Make the BTree objects (``BTree``, ``TreeSet``, ``Set``, ``Bucket``)
of each module actually provide the interfaces defined in
``BTrees.Interfaces``. Previously, they provided no interfaces.

- Make all the BTree and Bucket objects instances of
``collections.abc.MutableMapping`` (that is, ``isinstance(btree,
MutableMapping)`` is now true; no actual inheritance has changed).
As part of this, they now provide the ``popitem()`` method.

- Make all the TreeSet and Set objects instances of
``collections.abc.MutableSet`` (that is, ``isinstance(tree_set,
MutableSet)`` is now true; no actual inheritance has changed).
As part of this, they now provide several more methods, including
``isdisjoint``, ``discard``, and ``pop``, and support in-place
mutation operators such as ``tree_set |= other``, ``tree_set +=
other``, ``tree_set -= other`` and ``tree_set ^= other``. See `issue
121 <https://github.com/zopefoundation/BTrees/issues/121>`_.

- Update the definitions of ``ISized`` and ``IReadSequence`` to simply
be ``zope.interface.common.collections.ISized`` and
``zope.interface.common.sequence.IMinimalSequence`` respectively.

- Remove the ``__nonzero__`` interface method from ``ICollection``. No
objects actually implemented such a method; instead, the boolean value
is typically taken from ``__len__``.

- Adjust the definition of ``ISet`` to produce the same resolution
order under the C3 and legacy orderings. This means that the legacy
order has changed slightly, but that this package emits no warnings
when ``ZOPE_INTERFACE_LOG_CHANGED_IRO=1``. Note that the legacy
order was not being used for these objects because the C3 ordering
was still consistent; it could only be obtained using
``ZOPE_INTERFACE_USE_LEGACY_IRO=1``. See `PR 159
<https://github.com/zopefoundation/BTrees/pull/159>`_ for all the
interface updates.

- Fix the ``get``, ``setdefault`` and ``pop`` methods, as well as the
``in`` operator, to not suppress ``POSKeyError`` if the object or
subobjects are corrupted. Previously, such errors were logged by
ZODB, but not propagated. See `issue 161
<https://github.com/zopefoundation/BTrees/issues/161>`_.

4.7.2

==================

- Fix more cases of C and Python inconsistency. The C implementation
now behaves like the Python implementation when it comes to integer
overflow for the integer keys for ``in``, ``get`` and ``has_key``.
Now they return False, the default value, and False, respectively in
both versions if the tested value would overflow or underflow.
Previously, the C implementation would raise ``OverflowError`` or
``KeyError``, while the Python implementation functioned as
expected. See `issue 140
<https://github.com/zopefoundation/BTrees/issues/140>`_.

.. note::
The unspecified true return values of ``has_key``
have changed.

4.7.1

==================

- Fix the definitions of ``__all__`` in modules. In 4.7.0, they
incorrectly left out names. See `PR 132
<https://github.com/zopefoundation/BTrees/pull/132>`_.

- Ensure the interface resolution order of all objects is consistent.
See `issue 137 <https://github.com/zopefoundation/BTrees/issues/137>`_.

Page 3 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.