Zope.interface

Latest version: v6.4.post2

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

Scan your dependencies

Page 3 of 12

5.4.0

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

- Make the C implementation of the ``__providedBy__`` descriptor stop
ignoring all errors raised when accessing the instance's
``__provides__``. Now it behaves like the Python version and only
catches ``AttributeError``. The previous behaviour could lead to
crashing the interpreter in cases of recursion and errors. See
`issue 239 <https://github.com/zopefoundation/zope.interface/issues>`_.

- Update the ``repr()`` and ``str()`` of various objects to be shorter
and more informative. In many cases, the ``repr()`` is now something
that can be evaluated to produce an equal object. For example, what
was previously printed as ``<implementedBy builtins.list>`` is now
shown as ``classImplements(list, IMutableSequence, IIterable)``. See
`issue 236 <https://github.com/zopefoundation/zope.interface/issues/236>`_.

- Make ``Declaration.__add__`` (as in ``implementedBy(Cls) +
ISomething``) try harder to preserve a consistent resolution order
when the two arguments share overlapping pieces of the interface
inheritance hierarchy. Previously, the right hand side was always
put at the end of the resolution order, which could easily produce
invalid orders. See `issue 193
<https://github.com/zopefoundation/zope.interface/issues/193>`_.

5.3.0

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

- No changes from 5.3.0a1

5.3.0a1

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

- Improve the repr of ``zope.interface.Provides`` to remove ambiguity
about what is being provided. This is especially helpful diagnosing
IRO issues.

- Allow subclasses of ``BaseAdapterRegistry`` (including
``AdapterRegistry`` and ``VerifyingAdapterRegistry``) to have
control over the data structures. This allows persistent
implementations such as those based on ZODB to choose more scalable
options (e.g., BTrees instead of dicts). See `issue 224
<https://github.com/zopefoundation/zope.interface/issues/224>`_.

- Fix a reference counting issue in ``BaseAdapterRegistry`` that could
lead to references to interfaces being kept around even when all
utilities/adapters/subscribers providing that interface have been
removed. This is mostly an issue for persistent implementations.
Note that this only corrects the issue moving forward, it does not
solve any already corrupted reference counts. See `issue 227
<https://github.com/zopefoundation/zope.interface/issues/227>`_.

- Add the method ``BaseAdapterRegistry.rebuild()``. This can be used
to fix the reference counting issue mentioned above, as well as to
update the data structures when custom data types have changed.

- Add the interface method ``IAdapterRegistry.subscribed()`` and
implementation ``BaseAdapterRegistry.subscribed()`` for querying
directly registered subscribers. See `issue 230
<https://github.com/zopefoundation/zope.interface/issues/230>`_.

- Add the maintenance method
``Components.rebuildUtilityRegistryFromLocalCache()``. Most users
will not need this, but it can be useful if the ``Components.utilities``
registry is suspected to be out of sync with the ``Components``
object itself (this might happen to persistent ``Components``
implementations in the face of bugs).

- Fix the ``Provides`` and ``ClassProvides`` descriptors to stop
allowing redundant interfaces (those already implemented by the
underlying class or meta class) to produce an inconsistent
resolution order. This is similar to the change in ``implementer``
in 5.1.0, and resolves inconsistent resolution orders with
``zope.proxy`` and ``zope.location``. See `issue 207
<https://github.com/zopefoundation/zope.interface/issues/207>`_.

5.2.0

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

- Add documentation section ``Persistency and Equality``
(`218 <https://github.com/zopefoundation/zope.interface/issues/218>`_).

- Create arm64 wheels.

- Add support for Python 3.9.

5.1.2

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

- Make sure to call each invariant only once when validating invariants.
Previously, invariants could be called multiple times because when an
invariant is defined in an interface, it's found by in all interfaces
inheriting from that interface. See `pull request 215
<https://github.com/zopefoundation/zope.interface/pull/215/>`_.

5.1.1

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

- Fix the method definitions of ``IAdapterRegistry.subscribe``,
``subscriptions`` and ``subscribers``. Previously, they all were
defined to accept a ``name`` keyword argument, but subscribers have
no names and the implementation of that interface did not accept
that argument. See `issue 208
<https://github.com/zopefoundation/zope.interface/issues/208>`_.

- Fix a potential reference leak in the C optimizations. Previously,
applications that dynamically created unique ``Specification``
objects (e.g., used ``implementer`` on dynamic classes) could
notice a growth of small objects over time leading to increased
garbage collection times. See `issue 216
<https://github.com/zopefoundation/zope.interface/issues/216>`_.

.. caution::

This leak could prevent interfaces used as the bases of
other interfaces from being garbage collected. Those interfaces
will now be collected.

One way in which this would manifest was that ``weakref.ref``
objects (and things built upon them, like
``Weak[Key|Value]Dictionary``) would continue to have access to
the original object even if there were no other visible
references to Python and the original object *should* have been
collected. This could be especially problematic for the
``WeakKeyDictionary`` when combined with dynamic or local
(created in the scope of a function) interfaces, since interfaces
are hashed based just on their name and module name. See the
linked issue for an example of a resulting ``KeyError``.

Note that such potential errors are not new, they are just once
again a possibility.

Page 3 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.