Skip to main content

Interfaces for Python

Project description

zope.interface README

This package is intended to be independently reusable in any Python project. It is maintained by the Zope Toolkit project.

This package provides an implementation of “object interfaces” for Python. Interfaces are a mechanism for labeling objects as conforming to a given API or contract. So, this package can be considered as implementation of the Design By Contract methodology support in Python.

For detailed documentation, please see http://docs.zope.org/zope.interface

zope.interface Changelog

4.1.0 (2014-02-05)

  • Updated boostrap.py to version 2.2.

  • Added @named(name) declaration, that specifies the component name, so it does not have to be passed in during registration.

4.0.5 (2013-02-28)

  • Fixed a bug where a decorated method caused false positive failures on verifyClass().

4.0.4 (2013-02-21)

  • Fixed a bug that was revealed by porting zope.traversing. During a loop, the loop body modified a weakref dict causing a RuntimeError error.

4.0.3 (2012-12-31)

  • Fleshed out PyPI Trove classifiers.

4.0.2 (2012-11-21)

  • Added support for Python 3.3.

  • Restored ability to install the package in the absence of setuptools.

  • LP #1055223: Fix test which depended on dictionary order and failed randomly in Python 3.3.

4.0.1 (2012-05-22)

  • Dropped explicit DeprecationWarnings for “class advice” APIS (these APIs are still deprecated under Python 2.x, and still raise an exception under Python 3.x, but no longer cause a warning to be emitted under Python 2.x).

4.0.0 (2012-05-16)

  • Automated build of Sphinx HTML docs and running doctest snippets via tox.

  • Deprecated the “class advice” APIs from zope.interface.declarations: implements, implementsOnly, and classProvides. In their place, prefer the equivalent class decorators: @implementer, @implementer_only, and @provider. Code which uses the deprecated APIs will not work as expected under Py3k.

  • Removed use of ‘2to3’ and associated fixers when installing under Py3k. The code is now in a “compatible subset” which supports Python 2.6, 2.7, and 3.2, including PyPy 1.8 (the version compatible with the 2.7 language spec).

  • Dropped explicit support for Python 2.4 / 2.5 / 3.1.

  • Added support for PyPy.

  • Added support for continuous integration using tox and jenkins.

  • Added ‘setup.py dev’ alias (runs setup.py develop plus installs nose and coverage).

  • Added ‘setup.py docs’ alias (installs Sphinx and dependencies).

  • Replaced all unittest coverage previously accomplished via doctests with unittests. The doctests have been moved into a docs section, managed as a Sphinx collection.

  • LP #910987: Ensure that the semantics of the lookup method of zope.interface.adapter.LookupBase are the same in both the C and Python implementations.

  • LP #900906: Avoid exceptions due to tne new __qualname__ attribute added in Python 3.3 (see PEP 3155 for rationale). Thanks to Antoine Pitrou for the patch.

3.8.0 (2011-09-22)

  • New module zope.interface.registry. This is code moved from zope.component.registry which implements a basic nonperistent component registry as zope.interface.registry.Components. This class was moved from zope.component to make porting systems (such as Pyramid) that rely only on a basic component registry to Python 3 possible without needing to port the entirety of the zope.component package. Backwards compatibility import shims have been left behind in zope.component, so this change will not break any existing code.

  • New tests_require dependency: zope.event to test events sent by Components implementation. The zope.interface package does not have a hard dependency on zope.event, but if zope.event is importable, it will send component registration events when methods of an instance of zope.interface.registry.Components are called.

  • New interfaces added to support zope.interface.registry.Components addition: ComponentLookupError, Invalid, IObjectEvent, ObjectEvent, IComponentLookup, IRegistration, IUtilityRegistration, IAdapterRegistration, ISubscriptionAdapterRegistration, IHandlerRegistration, IRegistrationEvent, RegistrationEvent, IRegistered, Registered, IUnregistered, Unregistered, IComponentRegistry, and IComponents.

  • No longer Python 2.4 compatible (tested under 2.5, 2.6, 2.7, and 3.2).

3.7.0 (2011-08-13)

  • Move changes from 3.6.2 - 3.6.5 to a new 3.7.x release line.

3.6.7 (2011-08-20)

  • Fix sporadic failures on x86-64 platforms in tests of rich comparisons of interfaces.

3.6.6 (2011-08-13)

  • LP #570942: Now correctly compare interfaces from different modules but with the same names.

    N.B.: This is a less intrusive / destabilizing fix than the one applied in 3.6.3: we only fix the underlying cmp-alike function, rather than adding the other “rich comparison” functions.

  • Revert to software as released with 3.6.1 for “stable” 3.6 release branch.

3.6.5 (2011-08-11)

  • LP #811792: work around buggy behavior in some subclasses of zope.interface.interface.InterfaceClass, which invoke __hash__ before initializing __module__ and __name__. The workaround returns a fixed constant hash in such cases, and issues a UserWarning.

  • LP #804832: Under PyPy, zope.interface should not build its C extension. Also, prevent attempting to build it under Jython.

  • Add a tox.ini for easier xplatform testing.

  • Fix testing deprecation warnings issued when tested under Py3K.

3.6.4 (2011-07-04)

  • LP 804951: InterfaceClass instances were unhashable under Python 3.x.

3.6.3 (2011-05-26)

  • LP #570942: Now correctly compare interfaces from different modules but with the same names.

3.6.2 (2011-05-17)

  • Moved detailed documentation out-of-line from PyPI page, linking instead to http://docs.zope.org/zope.interface .

  • Fixes for small issues when running tests under Python 3.2 using zope.testrunner.

  • LP # 675064: Specify return value type for C optimizations module init under Python 3: undeclared value caused warnings, and segfaults on some 64 bit architectures.

  • setup.py now raises RuntimeError if you don’t have Distutils installed when running under Python 3.

3.6.1 (2010-05-03)

  • A non-ASCII character in the changelog made 3.6.0 uninstallable on Python 3 systems with another default encoding than UTF-8.

  • Fixed compiler warnings under GCC 4.3.3.

3.6.0 (2010-04-29)

  • LP #185974: Clear the cache used by Specificaton.get inside Specification.changed. Thanks to Jacob Holm for the patch.

  • Added support for Python 3.1. Contributors:

    Lennart Regebro Martin v Loewis Thomas Lotze Wolfgang Schnerring

    The 3.1 support is completely backwards compatible. However, the implements syntax used under Python 2.X does not work under 3.X, since it depends on how metaclasses are implemented and this has changed. Instead it now supports a decorator syntax (also under Python 2.X):

    class Foo:
        implements(IFoo)
        ...

    can now also be written:

    @implementer(IFoo):
    class Foo:
        ...

    There are 2to3 fixers available to do this change automatically in the zope.fixers package.

  • Python 2.3 is no longer supported.

3.5.4 (2009-12-23)

  • Use the standard Python doctest module instead of zope.testing.doctest, which has been deprecated.

3.5.3 (2009-12-08)

3.5.2 (2009-07-01)

  • BaseAdapterRegistry.unregister, unsubscribe: Remove empty portions of the data structures when something is removed. This avoids leaving references to global objects (interfaces) that may be slated for removal from the calling application.

3.5.1 (2009-03-18)

  • verifyObject: use getattr instead of hasattr to test for object attributes in order to let exceptions other than AttributeError raised by properties propagate to the caller

  • Add Sphinx-based documentation building to the package buildout configuration. Use the bin/docs command after buildout.

  • Improve package description a bit. Unify changelog entries formatting.

  • Change package’s mailing list address to zope-dev at zope.org as zope3-dev at zope.org is now retired.

3.5.0 (2008-10-26)

  • Fixed declaration of _zope_interface_coptimizations, it’s not a top level package.

  • Add a DocTestSuite for odd.py module, so their tests are run.

  • Allow to bootstrap on Jython.

  • Fix https://bugs.launchpad.net/zope3/3.3/+bug/98388: ISpecification was missing a declaration for __iro__.

  • Added optional code optimizations support, which allows the building of C code optimizations to fail (Jython).

  • Replaced _flatten with a non-recursive implementation, effectively making it 3x faster.

3.4.1 (2007-10-02)

  • Fixed a setup bug that prevented installation from source on systems without setuptools.

3.4.0 (2007-07-19)

  • Final release for 3.4.0.

3.4.0b3 (2007-05-22)

  • Objects with picky custom comparison methods couldn’t be added to component registries. Now, when checking whether an object is already registered, identity comparison is used.

3.3.0.1 (2007-01-03)

  • Made a reference to OverflowWarning, which disappeared in Python 2.5, conditional.

3.3.0 (2007/01/03)

New Features

  • The adapter-lookup algorithim was refactored to make it much simpler and faster.

    Also, more of the adapter-lookup logic is implemented in C, making debugging of application code easier, since there is less infrastructre code to step through.

  • We now treat objects without interface declarations as if they declared that they provide zope.interface.Interface.

  • There are a number of richer new adapter-registration interfaces that provide greater control and introspection.

  • Added a new interface decorator to zope.interface that allows the setting of tagged values on an interface at definition time (see zope.interface.taggedValue).

Bug Fixes

  • A bug in multi-adapter lookup sometimes caused incorrect adapters to be returned.

3.2.0.2 (2006-04-15)

  • Fix packaging bug: ‘package_dir’ must be a relative path.

3.2.0.1 (2006-04-14)

  • Packaging change: suppress inclusion of ‘setup.cfg’ in ‘sdist’ builds.

3.2.0 (2006-01-05)

  • Corresponds to the verison of the zope.interface package shipped as part of the Zope 3.2.0 release.

3.1.0 (2005-10-03)

  • Corresponds to the verison of the zope.interface package shipped as part of the Zope 3.1.0 release.

  • Made attribute resolution order consistent with component lookup order, i.e. new-style class MRO semantics.

  • Deprecated ‘isImplementedBy’ and ‘isImplementedByInstancesOf’ APIs in favor of ‘implementedBy’ and ‘providedBy’.

3.0.1 (2005-07-27)

  • Corresponds to the verison of the zope.interface package shipped as part of the Zope X3.0.1 release.

  • Fixed a bug reported by James Knight, which caused adapter registries to fail occasionally to reflect declaration changes.

3.0.0 (2004-11-07)

  • Corresponds to the verison of the zope.interface package shipped as part of the Zope X3.0.0 release.

Release history Release notifications | RSS feed

This version

4.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zope.interface-4.1.0.tar.gz (854.9 kB view details)

Uploaded Source

Built Distributions

zope.interface-4.1.0.win-amd64-py3.3.exe (358.8 kB view details)

Uploaded Source

zope.interface-4.1.0.win-amd64-py3.2.exe (360.8 kB view details)

Uploaded Source

zope.interface-4.1.0.win-amd64-py2.7.exe (360.6 kB view details)

Uploaded Source

zope.interface-4.1.0.win-amd64-py2.6.exe (360.6 kB view details)

Uploaded Source

zope.interface-4.1.0.win32-py3.3.exe (327.0 kB view details)

Uploaded Source

zope.interface-4.1.0.win32-py3.2.exe (332.1 kB view details)

Uploaded Source

zope.interface-4.1.0.win32-py2.7.exe (332.3 kB view details)

Uploaded Source

zope.interface-4.1.0.win32-py2.6.exe (332.3 kB view details)

Uploaded Source

zope.interface-4.1.0-py3.3-win-amd64.egg (299.3 kB view details)

Uploaded Egg

zope.interface-4.1.0-py3.3-win32.egg (298.4 kB view details)

Uploaded Egg

zope.interface-4.1.0-py3.2-win-amd64.egg (281.4 kB view details)

Uploaded Egg

zope.interface-4.1.0-py3.2-win32.egg (280.4 kB view details)

Uploaded Egg

zope.interface-4.1.0-py2.7-win-amd64.egg (275.3 kB view details)

Uploaded Egg

zope.interface-4.1.0-py2.7-win32.egg (274.4 kB view details)

Uploaded Egg

zope.interface-4.1.0-py2.6-win-amd64.egg (276.2 kB view details)

Uploaded Egg

zope.interface-4.1.0-py2.6-win32.egg (275.2 kB view details)

Uploaded Egg

File details

Details for the file zope.interface-4.1.0.tar.gz.

File metadata

File hashes

Hashes for zope.interface-4.1.0.tar.gz
Algorithm Hash digest
SHA256 7a03f08e26a9f88ceadcd51df684ca55864387d3c4fb8654eb3c1d83657840b8
MD5 ac63de1784ea0327db876c908af07a94
BLAKE2b-256 ff4a82c877f97f19bf926c91c285952182e02d962f23b137fd60c28c4dd07112

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0.win-amd64-py3.3.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.0.win-amd64-py3.3.exe
Algorithm Hash digest
SHA256 02e763cae9a46556c7338ddabb6629062d35e72ccd2fb0d8855a0e2e6e5e80da
MD5 2ff6aaaf6c6dae74468aaab37c1bf0b4
BLAKE2b-256 e2237a84b2e0484dc1936668e71ec8173e527dbf546e0316ad959a522b4cd443

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0.win-amd64-py3.2.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.0.win-amd64-py3.2.exe
Algorithm Hash digest
SHA256 2fa4c289db83b361184e1d55cbfad1e12ce9a07999e1b7d8f2f306e8ac428505
MD5 dde8cc088a4085326bb7fe364196ee50
BLAKE2b-256 1fcdbcd1cffdf9cb53f3020da80cac819f7081400e65d48e762c26eebf8b85ca

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0.win-amd64-py2.7.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.0.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 eed8c6468b0f365c020e50c08ba1f7ca060ee8f698c1a038b6b039e1a9e347dd
MD5 ed8a36568b41ff5c9946525e36c9ce08
BLAKE2b-256 cf0fc8ac96a4f358f0d793696703f600678b6184bc465f866be2158b7edf0001

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0.win-amd64-py2.6.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.0.win-amd64-py2.6.exe
Algorithm Hash digest
SHA256 ec12962d84770ce7a344c33ffcd53bb736a4c49f80037d90ab3afa410ab2b13d
MD5 2fdcc8721016372ae7465646cd468182
BLAKE2b-256 48416d142958c0c9f986e5677839a936cf11196c12f153dfad492d6e5191900c

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0.win32-py3.3.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.0.win32-py3.3.exe
Algorithm Hash digest
SHA256 f5c8b53d942b59081515938de0e54df34a9d8550c67096930a032b422321e1d9
MD5 30cb8e80070e7d1142c95f28b8c03782
BLAKE2b-256 df68cf2971f2ed233ca5ae150081aeeecae9c5d8ac84ad965a6189fe43977bc8

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0.win32-py3.2.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.0.win32-py3.2.exe
Algorithm Hash digest
SHA256 aa25ce54ac7e880139fae71783464c1884006d1a839d47a25e3d50f91a57a30c
MD5 0cd1969ae5caa2fc90978b6346e0310b
BLAKE2b-256 e961f4f3040a5d7d95fcac0edef566b4663843ae17b66adf71b4f8c3c45fac86

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0.win32-py2.7.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.0.win32-py2.7.exe
Algorithm Hash digest
SHA256 17ae9377de83ad6849bb288d63059cf63a82c69d0162fb44392c468b58cab48a
MD5 c0100a3cd6de6ecc3cd3b4d678ec7931
BLAKE2b-256 eb200f4fd95e9d9be13b59fe14ce1185562d54f3deaaf9db10af7e81f9e98e74

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0.win32-py2.6.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.0.win32-py2.6.exe
Algorithm Hash digest
SHA256 1da5df36cfe454b68acc7fb364c2cb9a01380d8f8a41024615b61ebc4a0457dd
MD5 8dcf2277a067dc5b440e419cadaf40a4
BLAKE2b-256 2868679c467c227e2662c00877cb12b730175897082bf3be83d34c5bcfc92e70

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0-py3.3-win-amd64.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.0-py3.3-win-amd64.egg
Algorithm Hash digest
SHA256 34c0633a1f2d88f3ed3ad674767a14dc34adb3d1d062ee5122ac13c086b9b394
MD5 d403b554c12eb3024c911117d50d1e85
BLAKE2b-256 0d9c089fcdaee4741d16327f9e08e8ea73b609816a43704bc8fc897dfac4266d

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0-py3.3-win32.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.0-py3.3-win32.egg
Algorithm Hash digest
SHA256 a7a9bfcc52df67245555a41ab23632879f62b611dfa3c99c1639747d78a83aff
MD5 e8eaa8c603108873e8c28df34a2a3397
BLAKE2b-256 4e9e37ec77a0f6d8109184f5580ed9c13bef341c7371785635c1edab7b45b0d9

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0-py3.2-win-amd64.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.0-py3.2-win-amd64.egg
Algorithm Hash digest
SHA256 74c0e797249e360210f4630931620fa8e905925e45c656dd246b0a4798d1a838
MD5 211302c2b4aaa8a4cd31f596f803e9bf
BLAKE2b-256 02a072f5abbc393c233aa902112b0a46021ce345a69af211b60109ed59bb80f6

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0-py3.2-win32.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.0-py3.2-win32.egg
Algorithm Hash digest
SHA256 aceac7e988e99cb8241fc9e13791d091ac3917741ceec851b88654933bfd8ec2
MD5 1e874a6c0916d0cff5ecbdd992fa4b29
BLAKE2b-256 5a13cb8ba940df44cd413d5e98c975a38e4ebc60443446257761bde735b2c248

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0-py2.7-win-amd64.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.0-py2.7-win-amd64.egg
Algorithm Hash digest
SHA256 73bb045cdef778954c552d4c6c567a6d2465567fb52aa61923e5222da3b05e5f
MD5 51d706b426e4fa636cb7a66b01ad9b7a
BLAKE2b-256 21e2e8b093b4c1e367ffc9dc44605fc66cab00908fbda777cb24b18f18e3a9b8

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0-py2.7-win32.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.0-py2.7-win32.egg
Algorithm Hash digest
SHA256 60fb122b2cf511788da6da802ee508361e53b204eecf6d7195fe8d8ad95d23ae
MD5 c8b9ab7d8b1855519034b96f6a7cc671
BLAKE2b-256 7dc68a9a4c019d667e3a8029979939404297f5723146b200845c111cc2de4622

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0-py2.6-win-amd64.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.0-py2.6-win-amd64.egg
Algorithm Hash digest
SHA256 8e1c00f312e192be0b5a7cca16475708c52386d4c4ddeb9b31915401f528146f
MD5 3a73abedf4e768534ce96e3d939f92d0
BLAKE2b-256 3165084405538ed8bac5acf20f20a4031d55756f25f08dc9604bdc4d0f7054cb

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.0-py2.6-win32.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.0-py2.6-win32.egg
Algorithm Hash digest
SHA256 4475833cb8fbb2be492fd598768a43dba2d4aa4ca461a35ee581c91903354700
MD5 cf7fc611e42ea4e86d0eb48e3136ba0e
BLAKE2b-256 1fb7b009fa10b4f8505c55b88b73a8ddaf73292b241b25bae2ece714620478c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page