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.1 (2014-03-19)

  • Added support for Python 3.4.

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

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.1.tar.gz (864.1 kB view details)

Uploaded Source

Built Distributions

zope.interface-4.1.1.win-amd64-py3.4.exe (358.9 kB view details)

Uploaded Source

zope.interface-4.1.1.win-amd64-py3.3.exe (358.9 kB view details)

Uploaded Source

zope.interface-4.1.1.win-amd64-py3.2.exe (360.9 kB view details)

Uploaded Source

zope.interface-4.1.1.win-amd64-py2.7.exe (360.7 kB view details)

Uploaded Source

zope.interface-4.1.1.win-amd64-py2.6.exe (360.7 kB view details)

Uploaded Source

zope.interface-4.1.1.win32-py3.4.exe (327.0 kB view details)

Uploaded Source

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

Uploaded Source

zope.interface-4.1.1.win32-py3.2.exe (332.2 kB view details)

Uploaded Source

zope.interface-4.1.1.win32-py2.7.exe (332.4 kB view details)

Uploaded Source

zope.interface-4.1.1.win32-py2.6.exe (332.4 kB view details)

Uploaded Source

zope.interface-4.1.1-py3.4-win-amd64.egg (288.5 kB view details)

Uploaded Egg

zope.interface-4.1.1-py3.4-win32.egg (287.8 kB view details)

Uploaded Egg

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

Uploaded Egg

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

Uploaded Egg

zope.interface-4.1.1-py3.2-win-amd64.egg (281.3 kB view details)

Uploaded Egg

zope.interface-4.1.1-py3.2-win32.egg (280.3 kB view details)

Uploaded Egg

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

Uploaded Egg

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

Uploaded Egg

zope.interface-4.1.1-py2.6-win-amd64.egg (276.1 kB view details)

Uploaded Egg

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

Uploaded Egg

File details

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

File metadata

  • Download URL: zope.interface-4.1.1.tar.gz
  • Upload date:
  • Size: 864.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zope.interface-4.1.1.tar.gz
Algorithm Hash digest
SHA256 91cba7b7cd7cb82f6f4e023fe77f94dc3df4ae5287fd55def2148dc232d0c7da
MD5 edcd5f719c5eb2e18894c4d06e29b6c6
BLAKE2b-256 a2afc4a17a2ab696c84c304f7c6c66236ee0ea019cf79852af32c7d3f89e0b8e

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.1.win-amd64-py3.4.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.1.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 f03b3fe5e509487440dc26b145c6a6aae14077b5b6c1b41acc7016e91324cbb8
MD5 06540a79497cce4b24b062fbbc945751
BLAKE2b-256 88256c4199cbcdad8ff157a85e5d53da031ddc07232e8211a9fbcaf1a215c6d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1.win-amd64-py3.3.exe
Algorithm Hash digest
SHA256 0ee638a1ebcbf136487f2c92e874b6d9cbaaf6e70fc712867a2761b7dbb959ce
MD5 ec85baec60720dc5749b8c58a9d4c19a
BLAKE2b-256 b8ae69c90d3f71e2902cd0644eb014909e87d2824dc0d4f8ca2b92c3e662f16a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1.win-amd64-py3.2.exe
Algorithm Hash digest
SHA256 6e0037b243f7d6d166f5a45a75775a0a5a94d74927f7e709319487281826ee78
MD5 71ef09e1f85379585c3c37b5387a06ad
BLAKE2b-256 d6bca482c3ebb63e18c070f314d1487bb2d275e7d37ae8a74a736ef2d8eb1ac8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 3a8d2e896ca4db983afff28781d7526db1bfe3196a0121f668b8f4d640732ffe
MD5 c3e22b49f84adaf169ec0d52eded4c8d
BLAKE2b-256 1318dfe000c68ec3eae9ac34328c6e36053e3d3ac6b83376f849b9574baa7dc2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1.win-amd64-py2.6.exe
Algorithm Hash digest
SHA256 f70fd1d6c0f39da445b4c9d9d8934b97cd5450672561408c46098ed2a4dbb614
MD5 2b741107ce491279bd05d4232041f57e
BLAKE2b-256 a031c6b2de9f5c5ff1c440317679a8f891a5c8c2c438ae888db1cdb81d72a882

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.1.win32-py3.4.exe.

File metadata

File hashes

Hashes for zope.interface-4.1.1.win32-py3.4.exe
Algorithm Hash digest
SHA256 05d7fa022cb4091895fc4fb5f44784ee1920d8fe4dabef465e36874884f5897d
MD5 875f64408e6f1deb3f02f68f191dabe4
BLAKE2b-256 253ba2886e96c63463dd8ea7253dc2f1d641a0c00cbc42860cd3a2f5dcdfef9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1.win32-py3.3.exe
Algorithm Hash digest
SHA256 b11afbe96d6bad31d747ab75fbada41727041446ed25c4d895ebe47049dae8f4
MD5 d1daaae7edfce14812c58ac7a6874682
BLAKE2b-256 f8fb47eba59393dc8d6815ce9d8d391da1bd757620af65a2cdcd4954a65e78f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1.win32-py3.2.exe
Algorithm Hash digest
SHA256 a75a2dd00eaec83ba5b517dca00cb2f2abfc08b1df52d8b7c309c2ebd2d36f0e
MD5 98c9cf88fdde0afedd87a819c29aa4f8
BLAKE2b-256 8a966f468de24464d95f270d2419501b060baddebca10caa877e450d5199146b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1.win32-py2.7.exe
Algorithm Hash digest
SHA256 32ecbb88ffb19f1fddb161fdb7f33e622ebd4a6fc9859c06aea2f2664d0af390
MD5 8b36e1fcd506ac9fb325ddf1c7238b07
BLAKE2b-256 91acfc1a474123e84d3a53c08ce1b0fb368d1b7c360cef582c7149ffe4859f4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1.win32-py2.6.exe
Algorithm Hash digest
SHA256 7f6a851844be21110b4ee84a1f5395a73da56425002fa3f83cd6bcc4adeb2355
MD5 2cebd98e97d89d50dd8aca97eb818e79
BLAKE2b-256 c8fd66029b4c611eb0a76a51caa1d5c24b5c0edb9619d12f71ae4948e70994da

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.1-py3.4-win-amd64.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.1-py3.4-win-amd64.egg
Algorithm Hash digest
SHA256 3f9be0c8a9a3dbabaa9166e245a977c16c486183dce17bab63800fb9889aaffd
MD5 ae17b497fbc551e6e07013aab1c6e33b
BLAKE2b-256 eae5337553db3e7b06f991dae83e182ece091fce2af5e17485533dc91a72c327

See more details on using hashes here.

File details

Details for the file zope.interface-4.1.1-py3.4-win32.egg.

File metadata

File hashes

Hashes for zope.interface-4.1.1-py3.4-win32.egg
Algorithm Hash digest
SHA256 4798f3511c809437b29213e84beb46d18b2f2ddedac5ce5f2ab7a19ff044682a
MD5 13864f4e5ef667644b0a266bdad623ee
BLAKE2b-256 95e59fdffb22657d0a292c48e169e6e88215832cc1b32eec11a31e23cc4dab28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1-py3.3-win-amd64.egg
Algorithm Hash digest
SHA256 8689b53ca94b17fd0cf40f23f1516d1dbe4bdd1971752c19cbe116bb9498d92a
MD5 cfbc9bad65482e6464cc82b3b836d89b
BLAKE2b-256 d04650961f4bddcefed6bd81d1c9c4fef65c289435571917f374f45217a909a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1-py3.3-win32.egg
Algorithm Hash digest
SHA256 2f1f6e12625cc3451c468ecbdb1f87b2890d1b704983ed8c8be732e8cbad66ab
MD5 ee634553059e94e7dfcdf0315648f6e8
BLAKE2b-256 40ab6614842aa5f11406c0124e3ede25a5fc872c9cdfceffc707fff3fbe43466

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1-py3.2-win-amd64.egg
Algorithm Hash digest
SHA256 cb868b674f2a0f1139f79a1d1e28fb2da9c1f3cb53c709f674971cdeda8d4cd6
MD5 0fa4a71f1b29846ddf31ea1faff55fda
BLAKE2b-256 157ae22c66f003223afdc282d8e3e86e1a11013a4ca4f48c123925fac384186f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1-py3.2-win32.egg
Algorithm Hash digest
SHA256 f37d39c17a3ecf4902fa6404f6b8ffedc2f298e5843170a0c914ee5fed94ed95
MD5 21c1122e75e248852a0d883bcc1970de
BLAKE2b-256 4053f6d4184559b4ea6c8287dc83c613aabe7d34850927681edc59d7319d4f1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1-py2.7-win-amd64.egg
Algorithm Hash digest
SHA256 7c9e23babd8951e93671bcc0e5102b849ebb1b92f516beff95f6b34997e1f96d
MD5 bd69a43b310361b75f6b9b4101737c92
BLAKE2b-256 0d6f8001d09216b3fb13abc0444f24e664ee1614da0fbe27ab3d072ef6892362

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1-py2.7-win32.egg
Algorithm Hash digest
SHA256 38bbace6ab0154ab9d5c989c9ad102d77de1cb76cd26368cacc5431dfd9ac067
MD5 97fc757b020bb25b829f9c566d87c8c3
BLAKE2b-256 a959c17c54ab44f9d856e7f75e49ed6057e976e3e7139b135db604cfeb6dc19f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1-py2.6-win-amd64.egg
Algorithm Hash digest
SHA256 4e73c76844437fb1eebf714b5759f6a56e9121e4b04bb31b73f7148e4fc00891
MD5 a0e00f1bc49e389794efd55bf1486e12
BLAKE2b-256 dbdc7437751ec2ffee363e2f69b0cdd9386ef8e12454c4acf993d8b553f668d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zope.interface-4.1.1-py2.6-win32.egg
Algorithm Hash digest
SHA256 646be264135bd6c3e38a647f919f02ba188c16e5c3f8c4c6b959e26cd30fbda0
MD5 3820d56c72483f9c63c0245b0990eeed
BLAKE2b-256 ecc0ff38b140f113cf449689148d4067f6766b057b4eea1e101be6da93ca0944

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