NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #420 most downloaded on PyPI
Interfaces for Python
Last release 1 months ago
20 Aug 2026
Release timing varies
gaps range from 2 weeks to 10 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
7 versions withdrawn
withdrawn after publishing
20 years old
90 releases · first in 2007
- Add support for Python 3.15.
Add support for Python 3.15.
Build and upload free-threaded (cp314t, cp315t) wheels for all platforms. Expand CI testing for free-threaded Python 3.14t from Linux-only to all plat
Build and upload free-threaded (cp314t, cp315t) wheels for all platforms. Expand CI testing for free-threaded Python 3.14t from Linux-only to all platforms (macOS, Windows), and add 3.15t CI. See issue 374.
Replace all remaining PyDict_GetItem() calls in the C extension with exception-safe alternatives (PyDict_Contains, PyDict_GetItemWithError). PyDict_GetItem silently swallows exceptions from __hash__/__eq__, causing isOrExtends() to return False instead of raising TypeError for unhashable objects. Also use PyType_GetDict() on Python 3.13+ for free-threading safety when accessing the type dict. See issue 357.
One column per quarter.
tagging experimental release 8.4.1a3
test tag 8.4.1a1 for testing sdist publishing
tagging release 8.4
Add support for automatically building and publishing Windows/ARM64 wheels.
Add support for free-threaded Python 3.14t: declare Py_mod_gil_not_used in C extension, replace borrowed-reference PyDict_GetItem() with strong-refere
Add support for free-threaded Python 3.14t: declare Py_mod_gil_not_used in C extension, replace borrowed-reference PyDict_GetItem() with strong-reference PyDict_GetItemRef() in cache lookups, and use Py_TYPE() macro instead of direct ob_type struct access.
Add CI testing for free-threaded Python 3.14t (Linux).
Guard 4 unprotected PyErr_Clear() calls in the C extension with PyErr_ExceptionMatches checks, matching the pattern already used at 7 other sites in the same file. Without the guard, KeyboardInterrupt, MemoryError, and SystemExit are silently swallowed in implementedBy and providedBy. See issue 358.
Move all supported package metadata into pyproject.toml.
Move all supported package metadata into pyproject.toml.
Ignore __annotate_func__ added in Python 3.14b1.
tagging release 8.1.1
Fix the GitHub workflow for publishing wheels, which failed for Linux/arm64. (#348)
test tag for PyPI publishing
- Drop support for Python 3.9. - Add support for Python 3.14.
Drop support for Python 3.9.
Add support for Python 3.14.
Make tests resilient against different ways of calling them.
Make tests resilient against different ways of calling them.
Remove run-time dependency on setuptools.
Replace pkg_resources namespace with PEP 420 native namespace.
Replace pkg_resources namespace with PEP 420 native namespace.
Drop support for Python 3.8.
Allow using newer setuptools version. (#333)
Add preliminary support for Python 3.14a2, this means that .common.builtins.IByteString and .common.collections.IByteString are no longer available fr
Add preliminary support for Python 3.14a2, this means that .common.builtins.IByteString and .common.collections.IByteString are no longer available from this Python version onwards as Python 3.14 dropped collections.abc.ByteString.
Fix segmentation faults in weakrefobject.c on Python 3.12 and 3.13. (#323 _)
Fix segmentation faults in weakrefobject.c on Python 3.12 and 3.13. (#323)
Declare support for Python 3.13.
Declare support for Python 3.13.
Fix segmentation faults on Python 3.13. (#323)
Fix Assertion 'memb->type -- T_PYSSIZET' failed. for Python < 3.12. (#319 _)
Fix Assertion 'memb->type -- T_PYSSIZET' failed. for Python < 3.12. (#319)
Fix reference-counting bug in C module initialization (broken in 7.0). (#316 _)
Fix reference-counting bug in C module initialization (broken in 7.0). (#316)
Fix subclassability of ObjectSpecificationDescriptor (broken in 7.0). (#312 _)
Fix subclassability of ObjectSpecificationDescriptor (broken in 7.0). (#312)
Enable heap-based types (PEP 384) for Python >= 3.11.
Enable heap-based types (PEP 384) for Python >= 3.11.
Adopt multi-phase module initialization (PEP 489).
Drop support for Python 3.7.
Publish missing Windows wheels, second attempt. (#295 _)
Publish missing Windows wheels, second attempt. (#295)
Publish missing Windows wheels. (#295 _)
Publish missing Windows wheels. (#295)
The sdist of version 6.4 was uploaded to PyPI as zope_interface-6.4.tar.gz instead of zope.interface-6.4-py2.tar.gz which cannot be installed by zc.bu
The sdist of version 6.4 was uploaded to PyPI as zope_interface-6.4.tar.gz instead of zope.interface-6.4-py2.tar.gz which cannot be installed by zc.buildout. This release is a re-release of version 6.4 with the correct sdist name. (#298)
Adjust for incompatible changes in Python 3.13b1. (#292 _)
Adjust for incompatible changes in Python 3.13b1. (#292)
Build windows wheels on GHA.
Add preliminary support for Python 3.13 as of 3.13a6.
Add preliminary support for Python 3.13 as of 3.13a6.
Add preliminary support for Python 3.13 as of 3.13a3.
Add preliminary support for Python 3.13 as of 3.13a3.
Add support to use the pipe (|) syntax for typing.Union. (#280)
Build Linux binary wheels for Python 3.12.
Build Linux binary wheels for Python 3.12.
Add support for Python 3.12.
Fix building of the docs for non-final versions.
Nothing published for this version
Nothing published for this version
Fix test deprecation warning on Python 3.11.
Build Linux binary wheels for Python 3.11.
Drop support for Python 2.7, 3.5, 3.6.
Fix test deprecation warning on Python 3.11.
Add preliminary support for Python 3.12 as of 3.12a5.
Drop:
zope.interface.implements
zope.interface.implementsOnly
zope.interface.classProvides
Add support for building arm64 wheels on macOS.
Add support for building arm64 wheels on macOS.
Add support for final Python 3.11 release.
Add support for final Python 3.11 release.
Add support for Python 3.10 and 3.11 (as of 3.11.0rc2).
Add support for Python 3.10 and 3.11 (as of 3.11.0rc2).
Add missing Trove classifier showing support for Python 3.9.
Add some more entries to zope.interface.interfaces.__all__.
Disable unsafe math optimizations in C code. See pull request 262.
Nothing published for this version
Make the C implementation of the __providedBy__ descriptor stop ignoring all errors raised when accessing the instance's __provides__. Now it behaves
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.
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.
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.
- No changes from 5.3.0a1
No changes from 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.
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.
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.
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.
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.
Add documentation section Persistency and Equality (#218 _).
Add documentation section Persistency and Equality (#218).
Create arm64 wheels.
Add support for Python 3.9.
Make sure to call each invariant only once when validating invariants. Previously, invariants could be called multiple times because when an invariant
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.
Fix the method definitions of IAdapterRegistry.subscribe, subscriptions and subscribers. Previously, they all were defined to accept a name keyword ar
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.
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.
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.
Make @implementer(*iface) and classImplements(cls, *iface) ignore redundant interfaces. If the class already implements an interface through inheritan
Make @implementer(*iface) and classImplements(cls, *iface) ignore redundant interfaces. If the class already implements an interface through inheritance, it is no longer redeclared specifically for cls. This solves many instances of inconsistent resolution orders, while still allowing the interface to be declared for readability and maintenance purposes. See issue 199.
Remove all bare except: statements. Previously, when accessing special attributes such as __provides__, __providedBy__, __class__ and __conform__, this package wrapped such access in a bare except: statement, meaning that many errors could pass silently; typically this would result in a fallback path being taken and sometimes (like with providedBy()) the result would be non-sensical. This is especially true when those attributes are implemented with descriptors. Now, only AttributeError is caught. This makes errors more obvious.
Obviously, this means that some exceptions will be propagated differently than before. In particular, RuntimeError raised by Acquisition in the case of circular containment will now be propagated. Previously, when adapting such a broken object, a TypeError would be the common result, but now it will be a more informative RuntimeError.
In addition, ZODB errors like POSKeyError could now be propagated where previously they would ignored by this package.
See issue 200.
Require that the second argument (bases) to InterfaceClass is a tuple. This only matters when directly using InterfaceClass to create new interfaces dynamically. Previously, an individual interface was allowed, but did not work correctly. Now it is consistent with type and requires a tuple.
Let interfaces define custom __adapt__ methods. This implements the other side of the 246 adaptation protocol: objects being adapted could already implement __conform__ if they know about the interface, and now interfaces can implement __adapt__ if they know about particular objects. There is no performance penalty for interfaces that do not supply custom __adapt__ methods.
This includes the ability to add new methods, or override existing interface methods using the new @interfacemethod decorator.
See issue 3.
Make the internal singleton object returned by APIs like implementedBy and directlyProvidedBy for objects that implement or provide no interfaces more immutable. Previously an internal cache could be mutated. See issue 204.
Ensure that objects that implement no interfaces (such as direct subclasses of object) still include Interface itself in their __iro___ and __sro___.
Ensure that objects that implement no interfaces (such as direct subclasses of object) still include Interface itself in their __iro___ and __sro___. This fixes adapter registry lookups for such objects when the adapter is registered for Interface. See issue 197.
Ensure the resolution order for InterfaceClass is consistent. See issue 192 _.
Ensure the resolution order for InterfaceClass is consistent. See issue 192.
Ensure the resolution order for collections.OrderedDict is consistent on CPython 2. (It was already consistent on Python 3 and PyPy).
Fix the handling of the ZOPE_INTERFACE_STRICT_IRO environment variable. Previously, ZOPE_INTERFACE_STRICT_RO was read, in contrast with the documentation. See issue 194.
Make an internal singleton object returned by APIs like implementedBy and directlyProvidedBy immutable. Previously, it was fully mutable and allowed c
Make an internal singleton object returned by APIs like implementedBy and directlyProvidedBy immutable. Previously, it was fully mutable and allowed changing its __bases___. That could potentially lead to wrong results in pathological corner cases. See issue 158.
Support the PURE_PYTHON environment variable at runtime instead of just at wheel build time. A value of 0 forces the C extensions to be used (even on PyPy) failing if they aren't present. Any other value forces the Python implementation to be used, ignoring the C extensions. See PR 151.
Cache the result of __hash__ method in InterfaceClass as a speed optimization. The method is called very often (i.e several hundred thousand times during Plone 5.2 startup). Because the hash value never changes it can be cached. This improves test performance from 0.614s down to 0.575s (1.07x faster). In a real world Plone case a reindex index came down from 402s to 320s (1.26x faster). See PR 156.
Change the C classes SpecificationBase and its subclass ClassProvidesBase to store implementation attributes in their structures instead of their instance dictionaries. This eliminates the use of an undocumented private C API function, and helps make some instances require less memory. See PR 154.
Reduce memory usage in other ways based on observations of usage patterns in Zope (3) and Plone code bases.
Specifications with no dependents are common (more than 50%) so avoid allocating a WeakKeyDictionary unless we need it.
Likewise, tagged values are relatively rare, so don't allocate a dictionary to hold them until they are used.
Use __slots___ or the C equivalent tp_members in more common places. Note that this removes the ability to set arbitrary instance variables on certain objects. See PR 155.
The changes in this release resulted in a 7% memory reduction after loading about 6,000 modules that define about 2,200 interfaces.
Caution!
Details of many private attributes have changed, and external use of those private attributes may break. In particular, the lifetime and default value of _v_attrs has changed.
Remove support for hashing uninitialized interfaces. This could only be done by subclassing InterfaceClass. This has generated a warning since it was first added in 2011 (3.6.5). Please call the InterfaceClass constructor or otherwise set the appropriate fields in your subclass before attempting to hash or sort it. See issue 157.
Remove unneeded override of the __hash__ method from zope.interface.declarations.Implements. Watching a reindex index process in ZCatalog with on a Py-Spy after 10k samples the time for .adapter._lookup was reduced from 27.5s to 18.8s (~1.5x faster). Overall reindex index time shrunk from 369s to 293s (1.26x faster). See PR 161.
Make the Python implementation closer to the C implementation by ignoring all exceptions, not just AttributeError, during (parts of) interface adaptation. See issue 163.
Micro-optimization in .adapter._lookup , .adapter._lookupAll and .adapter._subscriptions: By loading components.get into a local variable before entering the loop a bytcode "LOAD_FAST 0 (components)" in the loop can be eliminated. In Plone, while running all tests, average speedup of the "owntime" of _lookup is ~5x. See PR 167.
Add __all__ declarations to all modules. This helps tools that do auto-completion and documentation and results in less cluttered results. Wildcard ("*") are not recommended and may be affected. See issue 153.
Fix verifyClass and verifyObject for builtin types like dict that have methods taking an optional, unnamed argument with no default value like dict.pop. On PyPy3, the verification is strict, but on PyPy2 (as on all versions of CPython) those methods cannot be verified and are ignored. See issue 118.
Update the common interfaces IEnumerableMapping, IExtendedReadMapping, IExtendedWriteMapping, IReadSequence and IUniqueMemberWriteSequence to no longer require methods that were removed from Python 3 on Python 3, such as __setslice___. Now, dict, list and tuple properly verify as IFullMapping, ISequence and IReadSequence, respectively on all versions of Python.
Add human-readable __str___ and __repr___ to Attribute and Method. These contain the name of the defining interface and the attribute. For methods, it also includes the signature.
Change the error strings raised by verifyObject and verifyClass. They now include more human-readable information and exclude extraneous lines and spaces. See issue 170.
Caution!
This will break consumers (such as doctests) that depended on the exact error messages.
Make verifyObject and verifyClass report all errors, if the candidate object has multiple detectable violations. Previously they reported only the first error. See issue.
Like the above, this will break consumers depending on the exact output of error messages if more than one error is present.
Add zope.interface.common.collections, zope.interface.common.numbers, and zope.interface.common.io. These modules define interfaces based on the ABCs defined in the standard library collections.abc, numbers and io modules, respectively. Importing these modules will make the standard library concrete classes that are registered with those ABCs declare the appropriate interface. See issue 138.
Add zope.interface.common.builtins. This module defines interfaces of common builtin types, such as ITextString and IByteString, IDict, etc. These interfaces extend the appropriate interfaces from collections and numbers, and the standard library classes implement them after importing this module. This is intended as a replacement for third-party packages like dolmen.builtins. See issue 138.
Make providedBy() and implementedBy() respect super objects. For instance, if class Derived implements IDerived and extends Base which in turn implements IBase, then providedBy(super(Derived, derived)) will return [IBase]. Previously it would have returned [IDerived] (in general, it would previously have returned whatever would have been returned without super).
Along with this change, adapter registries will unpack super objects into their __self___ before passing it to the factory. Together, this means that component.getAdapter(super(Derived, self), ITarget) is now meaningful.
See issue 11.
Fix a potential interpreter crash in the low-level adapter registry lookup functions. See issue 11.
Adopt Python's standard C3 resolution order to compute the __iro__ and __sro__ of interfaces, with tweaks to support additional cases that are common in interfaces but disallowed for Python classes. Previously, an ad-hoc ordering that made no particular guarantees was used.
This has many beneficial properties, including the fact that base interface and base classes tend to appear near the end of the resolution order instead of the beginning. The resolution order in general should be more predictable and consistent.
Caution!
In some cases, especially with complex interface inheritance trees or when manually providing or implementing interfaces, the resulting IRO may be quite different. This may affect adapter lookup.
The C3 order enforces some constraints in order to be able to guarantee a sensible ordering. Older versions of zope.interface did not impose similar constraints, so it was possible to create interfaces and declarations that are inconsistent with the C3 constraints. In that event, zope.interface will still produce a resolution order equal to the old order, but it won't be guaranteed to be fully C3 compliant. In the future, strict enforcement of C3 order may be the default.
A set of environment variables and module constants allows controlling several aspects of this new behaviour. It is possible to request warnings about inconsistent resolution orders encountered, and even to forbid them. Differences between the C3 resolution order and the previous order can be logged, and, in extreme cases, the previous order can still be used (this ability will be removed in the future). For details, see the documentation for zope.interface.ro.
Make inherited tagged values in interfaces respect the resolution order (__iro__), as method and attribute lookup does. Previously tagged values could give inconsistent results. See issue 190.
Add getDirectTaggedValue (and related methods) to interfaces to allow accessing tagged values irrespective of inheritance. See issue 190.
Ensure that Interface is always the last item in the __iro__ and __sro__. This is usually the case, but if classes that do not implement any interfaces are part of a class inheritance hierarchy, Interface could be assigned too high a priority. See issue 8.
Implement sorting, equality, and hashing in C for Interface objects. In micro benchmarks, this makes those operations 40% to 80% faster. This translates to a 20% speed up in querying adapters.
Note that this changes certain implementation details. In particular, InterfaceClass now has a non-default metaclass, and it is enforced that __module__ in instances of InterfaceClass is read-only.
See PR 183.
Remove deprecated use of setuptools features. See issue 30 _.
Remove deprecated use of setuptools features. See issue 30.
Use Python 3 syntax in the documentation. See issue 119 _.
Use Python 3 syntax in the documentation. See issue 119.
.. caution:: This may be a breaking change.
Drop support for Python 3.4.
Change queryTaggedValue, getTaggedValue, getTaggedValueTags in interfaces. They now include inherited values by following __bases__. See PR 144.
Caution!
This may be a breaking change.
Add support for Python 3.8.
Fix verifyObject for class objects with staticmethods on Python 3. See issue 126 _.
Add support for Python 3.7
Fix verifyObject for class objects with staticmethods on Python 3. See issue 126.
Drop support for 3.3, avoid accidental dependence breakage via setup.py. See PR 110 _.
Avoid exceptions when the __annotations__ attribute is added to interface definitions with Python 3.x type hints. See issue 98 _.
Fix a regression storing zope.component.persistentregistry.PersistentRegistry instances. See issue 85 _.
Simplify the caching of utility-registration data. In addition to simplification, avoids spurious test failures when checking for leaks in tests with
Simplify the caching of utility-registration data. In addition to simplification, avoids spurious test failures when checking for leaks in tests with persistent registries. See pull 84.
Raise ValueError when non-text names are passed to adapter registry methods: prevents corruption of lookup caches.
Avoid a warning from the C compiler.
Avoid a warning from the C compiler. (https://github.com/zopefoundation/zope.interface/issues/71)
Add support for Python 3.6.
Correct typos and ReST formatting errors in documentation.
Correct typos and ReST formatting errors in documentation.
Add API documentation for the adapter registry.
Ensure that the LICENSE.txt file is included in built wheels.
Fix C optimizations broken on Py3k. See the Python bug at: http://bugs.python.org/issue15657 (https://github.com/zopefoundation/zope.interface/issues/60)
Fix equality testing of implementedBy objects and proxies.
Fix equality testing of implementedBy objects and proxies. (https://github.com/zopefoundation/zope.interface/issues/55)
Support Components subclasses that are not hashable.
Support Components subclasses that are not hashable. (https://github.com/zopefoundation/zope.interface/issues/53)
Add the ability to sort the objects returned by implementedBy. This is compatible with the way interface classes sort so they can be used together in
Add the ability to sort the objects returned by implementedBy. This is compatible with the way interface classes sort so they can be used together in ordered containers like BTrees. (https://github.com/zopefoundation/zope.interface/issues/42)
Make setuptools a hard dependency of setup.py. (https://github.com/zopefoundation/zope.interface/issues/13)
Change a linear algorithm (O(n)) in Components.registerUtility and Components.unregisterUtility into a dictionary lookup (O(1)) for hashable components. This substantially improves the time taken to manipulate utilities in large registries at the cost of some additional memory usage. (https://github.com/zopefoundation/zope.interface/issues/46)
Drop support for Python 2.6 and 3.2.
Add support for Python 3.5
Drop support for Python 2.6 and 3.2.
Fix installation without a C compiler on Python 3.5 (https://github.com/zopefoundation/zope.interface/issues/24).
Fix installation without a C compiler on Python 3.5 (https://github.com/zopefoundation/zope.interface/issues/24).
Remove unittest assertions deprecated in Python3.x.
Add support for PyPy3.
Remove unittest assertions deprecated in Python3.x.
Add zope.interface.document.asReStructuredText, which formats the generated text for an interface using ReST double-backtick markers.
- Add support for Python 3.4.
Add support for Python 3.4.
Your coding agent can read these notes before it upgrades. Set up the MCP server →