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.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

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.0.4.zip (173.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

zope.interface-4.0.4.win-amd64-py3.3.exe (357.8 kB view details)

Uploaded Source

zope.interface-4.0.4.win-amd64-py3.2.exe (359.9 kB view details)

Uploaded Source

zope.interface-4.0.4.win-amd64-py2.7.exe (359.6 kB view details)

Uploaded Source

zope.interface-4.0.4.win-amd64-py2.6.exe (359.6 kB view details)

Uploaded Source

zope.interface-4.0.4.win32-py3.3.exe (326.0 kB view details)

Uploaded Source

zope.interface-4.0.4.win32-py3.2.exe (331.1 kB view details)

Uploaded Source

zope.interface-4.0.4.win32-py2.7.exe (331.3 kB view details)

Uploaded Source

zope.interface-4.0.4.win32-py2.6.exe (331.3 kB view details)

Uploaded Source

zope.interface-4.0.4-py3.3-win-amd64.egg (297.4 kB view details)

Uploaded Egg

zope.interface-4.0.4-py3.3-win32.egg (296.4 kB view details)

Uploaded Egg

zope.interface-4.0.4-py3.2-win-amd64.egg (279.4 kB view details)

Uploaded Egg

zope.interface-4.0.4-py3.2-win32.egg (278.5 kB view details)

Uploaded Egg

zope.interface-4.0.4-py2.7-win-amd64.egg (273.6 kB view details)

Uploaded Egg

zope.interface-4.0.4-py2.7-win32.egg (272.7 kB view details)

Uploaded Egg

zope.interface-4.0.4-py2.6-win-amd64.egg (274.5 kB view details)

Uploaded Egg

zope.interface-4.0.4-py2.6-win32.egg (273.5 kB view details)

Uploaded Egg

File details

Details for the file zope.interface-4.0.4.zip.

File metadata

  • Download URL: zope.interface-4.0.4.zip
  • Upload date:
  • Size: 173.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zope.interface-4.0.4.zip
Algorithm Hash digest
SHA256 b47c9e420b85eac9aef653473a266f39f219a5ad401cb1c2be4afff9b5b8566e
MD5 b74c4da844e1f96b7e29f0324f14377d
BLAKE2b-256 792023a48be555a597114f2a4f5646ac5b586f6bfaf122179e177bf5950a9567

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4.win-amd64-py3.3.exe
Algorithm Hash digest
SHA256 a2503346b33e6cb6e1f30f22c9d4323d7c056a314345cd21c3c9b215de40c594
MD5 d6d57941e637f26ddfa7585d8b150450
BLAKE2b-256 e7e7140194c4d3a8ee0f97957cd961e1bef8203d87ad3e0c565974028c643de6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4.win-amd64-py3.2.exe
Algorithm Hash digest
SHA256 5fde18ce593d06284ad5beb5ac576445e52e54b65dbd822f3f7accd1fdbce630
MD5 37651ae9c18d7032c36f50fe05ed0fef
BLAKE2b-256 0f1172a7319f0170873bb613d83aefc45031eab1226f1b529f54ebb2904cff38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 5eb32dcc09574e50ac6947c584a76ec94f693378b4f65feb5ed1a2984944763e
MD5 a84e28c71b1bd4ed858f9eee63e04956
BLAKE2b-256 9e43f93d393d1691e17f0fe81b50d0fa6266489cbc0e86ba463dee092cc2418a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4.win-amd64-py2.6.exe
Algorithm Hash digest
SHA256 f8527fd3e90cdcd58bc12bfeaa0b892e433937d9b8bb3dee591fcce905d9ab00
MD5 c1c95c72a536a97bb03b0b594fcf1aed
BLAKE2b-256 26e4082ca3003fd0928896833824933f29561e143e99f9d1486ec7bd133c55e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4.win32-py3.3.exe
Algorithm Hash digest
SHA256 256baf9cd2c3daa196a14d118b183cd335f298bcad0501d583e78f2acdf78371
MD5 c24d22c88f01f55eaf41d5f3116b5afe
BLAKE2b-256 5024d62b292e552fb0a152bfe1360c9ca51ae889664541d5ea34b8ce2ec035a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4.win32-py3.2.exe
Algorithm Hash digest
SHA256 c31e9fbbd8ab7fd41435e908129abe62864f029f9eb2462bc80fd0a172d7671a
MD5 2bded7927246d5a7d393f5e94c759b2d
BLAKE2b-256 0149b7da488a57116973b81680341da6ca2e1f5dc3820fc69fd6cb15ca40dc54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4.win32-py2.7.exe
Algorithm Hash digest
SHA256 1f347d108eee13891a982ed933f6584bddc4090397333389e228c1dc15c7f192
MD5 1c37a49f6bc0341c05d040abe7134485
BLAKE2b-256 7cade5579f8748509ecddd5cd5aaf7cd9263f55555f8d3c14a9460a2d844ef27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4.win32-py2.6.exe
Algorithm Hash digest
SHA256 8898da3c7b544343c7f98882f135ccf57276e96b0e78b6dc941bdc1127207ee0
MD5 b0f69e62d2b59a5c60b31a1091ad9ccf
BLAKE2b-256 858aee042701ba8782a2cc0295f262275685742666f55140c974631d5d1f6a74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4-py3.3-win-amd64.egg
Algorithm Hash digest
SHA256 8a172371fdce046c9148d9df095a2bf2f95c4d0978320b2c09ca205e852b7ac3
MD5 dbbf9f64b59c9e5461fcfed04940d9dd
BLAKE2b-256 c9d186123638603bdec64c1905779b81fc1e91b87c45ea1d30a7ba19cce884c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4-py3.3-win32.egg
Algorithm Hash digest
SHA256 acf259382816ddc93a4c40ef9cc16df3b5dc5b55d5a69daee4d56e4c5e749c29
MD5 982eaa632093419b34c562a3ef152946
BLAKE2b-256 7ef37b50dbf6a129ee82a1db5e3f79aa5e2d09cc5f43e895c981f9c5c4e93723

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4-py3.2-win-amd64.egg
Algorithm Hash digest
SHA256 b0ee63cba41f060ec56922de9e64b0583d67253b4f13e0f40f6ac728b43729db
MD5 c889b7ffbcba039ccd4a7a80ec60a71e
BLAKE2b-256 41ee1f561c9a0fcaf0403a743c44ad5d3ba24473af43a6469059d21b46674ef4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4-py3.2-win32.egg
Algorithm Hash digest
SHA256 eb2f5340d7f22ec61684bed9f3385bd8da50ad5bd8075f68d21e7319dbe4624f
MD5 bc4e7416f3aac17db9d09324009bfac5
BLAKE2b-256 84dc400a66fdc87332ed599fa00495c16d1870a8c1e23aa664ec693033febda4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4-py2.7-win-amd64.egg
Algorithm Hash digest
SHA256 8f403c766a12a05b9427bc1bb9640634dadec6f5f65b26e3698fe987361f324c
MD5 909bc9fa53d737a2e6ad80865d791413
BLAKE2b-256 ef0b82ee657773684db711731edbdb737f763aff1a583693e0b29f16b03cd23f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4-py2.7-win32.egg
Algorithm Hash digest
SHA256 2d6b1b10d99870ec3c221081d98cdfc3a2530a4f62a4840dfd501f416fa1dacf
MD5 969b0fa700788eedcb3ef0b56ef2712a
BLAKE2b-256 5cd512fae3015b75451a33d33660c99475ebb0d1a76c4975d4f40b87ff2e2fd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4-py2.6-win-amd64.egg
Algorithm Hash digest
SHA256 271fc60b532a03529aa717025f821da7f13feb897736dd76e0fd841369f43e6e
MD5 36c167adf704321430877659bded4780
BLAKE2b-256 ebe1ba88cbb39a17e40e396b4fd8c078bdeaeaf36e8c33850d5969c4c28c009d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.0.4-py2.6-win32.egg
Algorithm Hash digest
SHA256 7d0cc7eb0d7ca7b0815fca842cc36c2c056f8a0041781320761c557dbda6edf3
MD5 c64c330fedd4ff339bfe4e7028f634f1
BLAKE2b-256 1fc0d8c1c18b5b80e532eb1ba3fb84b1f96f2fa5b5daa19374bc4730c7181c9e

See more details on using hashes here.

Supported by

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