METADATA 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  1. Metadata-Version: 2.1
  2. Name: zope.interface
  3. Version: 6.3
  4. Summary: Interfaces for Python
  5. Home-page: https://github.com/zopefoundation/zope.interface
  6. Author: Zope Foundation and Contributors
  7. Author-email: zope-dev@zope.org
  8. License: ZPL 2.1
  9. Keywords: interface,components,plugins
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: Zope Public License
  13. Classifier: Operating System :: OS Independent
  14. Classifier: Programming Language :: Python
  15. Classifier: Programming Language :: Python :: 3
  16. Classifier: Programming Language :: Python :: 3.7
  17. Classifier: Programming Language :: Python :: 3.8
  18. Classifier: Programming Language :: Python :: 3.9
  19. Classifier: Programming Language :: Python :: 3.10
  20. Classifier: Programming Language :: Python :: 3.11
  21. Classifier: Programming Language :: Python :: 3.12
  22. Classifier: Programming Language :: Python :: Implementation :: CPython
  23. Classifier: Programming Language :: Python :: Implementation :: PyPy
  24. Classifier: Framework :: Zope :: 3
  25. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  26. Requires-Python: >=3.7
  27. License-File: LICENSE.txt
  28. Requires-Dist: setuptools
  29. Provides-Extra: docs
  30. Requires-Dist: Sphinx ; extra == 'docs'
  31. Requires-Dist: repoze.sphinx.autointerface ; extra == 'docs'
  32. Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
  33. Provides-Extra: test
  34. Requires-Dist: coverage >=5.0.3 ; extra == 'test'
  35. Requires-Dist: zope.event ; extra == 'test'
  36. Requires-Dist: zope.testing ; extra == 'test'
  37. Provides-Extra: testing
  38. Requires-Dist: coverage >=5.0.3 ; extra == 'testing'
  39. Requires-Dist: zope.event ; extra == 'testing'
  40. Requires-Dist: zope.testing ; extra == 'testing'
  41. ====================
  42. ``zope.interface``
  43. ====================
  44. .. image:: https://img.shields.io/pypi/v/zope.interface.svg
  45. :target: https://pypi.python.org/pypi/zope.interface/
  46. :alt: Latest Version
  47. .. image:: https://img.shields.io/pypi/pyversions/zope.interface.svg
  48. :target: https://pypi.org/project/zope.interface/
  49. :alt: Supported Python versions
  50. .. image:: https://github.com/zopefoundation/zope.interface/actions/workflows/tests.yml/badge.svg
  51. :target: https://github.com/zopefoundation/zope.interface/actions/workflows/tests.yml
  52. .. image:: https://readthedocs.org/projects/zopeinterface/badge/?version=latest
  53. :target: https://zopeinterface.readthedocs.io/en/latest/
  54. :alt: Documentation Status
  55. This package is intended to be independently reusable in any Python
  56. project. It is maintained by the `Zope Toolkit project
  57. <https://zopetoolkit.readthedocs.io/>`_.
  58. This package provides an implementation of "object interfaces" for Python.
  59. Interfaces are a mechanism for labeling objects as conforming to a given
  60. API or contract. So, this package can be considered as implementation of
  61. the `Design By Contract`_ methodology support in Python.
  62. .. _Design By Contract: http://en.wikipedia.org/wiki/Design_by_contract
  63. For detailed documentation, please see https://zopeinterface.readthedocs.io/en/latest/
  64. =========
  65. Changes
  66. =========
  67. 6.3 (2024-04-12)
  68. ================
  69. - Add preliminary support for Python 3.13 as of 3.13a6.
  70. 6.2 (2024-02-16)
  71. ================
  72. - Add preliminary support for Python 3.13 as of 3.13a3.
  73. - Add support to use the pipe (``|``) syntax for ``typing.Union``.
  74. (`#280 <https://github.com/zopefoundation/zope.interface/issues/280>`_)
  75. 6.1 (2023-10-05)
  76. ================
  77. - Build Linux binary wheels for Python 3.12.
  78. - Add support for Python 3.12.
  79. - Fix building of the docs for non-final versions.
  80. 6.0 (2023-03-17)
  81. ================
  82. - Build Linux binary wheels for Python 3.11.
  83. - Drop support for Python 2.7, 3.5, 3.6.
  84. - Fix test deprecation warning on Python 3.11.
  85. - Add preliminary support for Python 3.12 as of 3.12a5.
  86. - Drop:
  87. + `zope.interface.implements`
  88. + `zope.interface.implementsOnly`
  89. + `zope.interface.classProvides`
  90. 5.5.2 (2022-11-17)
  91. ==================
  92. - Add support for building arm64 wheels on macOS.
  93. 5.5.1 (2022-11-03)
  94. ==================
  95. - Add support for final Python 3.11 release.
  96. 5.5.0 (2022-10-10)
  97. ==================
  98. - Add support for Python 3.10 and 3.11 (as of 3.11.0rc2).
  99. - Add missing Trove classifier showing support for Python 3.9.
  100. - Add some more entries to ``zope.interface.interfaces.__all__``.
  101. - Disable unsafe math optimizations in C code. See `pull request 262
  102. <https://github.com/zopefoundation/zope.interface/pull/262>`_.
  103. 5.4.0 (2021-04-15)
  104. ==================
  105. - Make the C implementation of the ``__providedBy__`` descriptor stop
  106. ignoring all errors raised when accessing the instance's
  107. ``__provides__``. Now it behaves like the Python version and only
  108. catches ``AttributeError``. The previous behaviour could lead to
  109. crashing the interpreter in cases of recursion and errors. See
  110. `issue 239 <https://github.com/zopefoundation/zope.interface/issues>`_.
  111. - Update the ``repr()`` and ``str()`` of various objects to be shorter
  112. and more informative. In many cases, the ``repr()`` is now something
  113. that can be evaluated to produce an equal object. For example, what
  114. was previously printed as ``<implementedBy builtins.list>`` is now
  115. shown as ``classImplements(list, IMutableSequence, IIterable)``. See
  116. `issue 236 <https://github.com/zopefoundation/zope.interface/issues/236>`_.
  117. - Make ``Declaration.__add__`` (as in ``implementedBy(Cls) +
  118. ISomething``) try harder to preserve a consistent resolution order
  119. when the two arguments share overlapping pieces of the interface
  120. inheritance hierarchy. Previously, the right hand side was always
  121. put at the end of the resolution order, which could easily produce
  122. invalid orders. See `issue 193
  123. <https://github.com/zopefoundation/zope.interface/issues/193>`_.
  124. 5.3.0 (2020-03-21)
  125. ==================
  126. - No changes from 5.3.0a1
  127. 5.3.0a1 (2021-03-18)
  128. ====================
  129. - Improve the repr of ``zope.interface.Provides`` to remove ambiguity
  130. about what is being provided. This is especially helpful diagnosing
  131. IRO issues.
  132. - Allow subclasses of ``BaseAdapterRegistry`` (including
  133. ``AdapterRegistry`` and ``VerifyingAdapterRegistry``) to have
  134. control over the data structures. This allows persistent
  135. implementations such as those based on ZODB to choose more scalable
  136. options (e.g., BTrees instead of dicts). See `issue 224
  137. <https://github.com/zopefoundation/zope.interface/issues/224>`_.
  138. - Fix a reference counting issue in ``BaseAdapterRegistry`` that could
  139. lead to references to interfaces being kept around even when all
  140. utilities/adapters/subscribers providing that interface have been
  141. removed. This is mostly an issue for persistent implementations.
  142. Note that this only corrects the issue moving forward, it does not
  143. solve any already corrupted reference counts. See `issue 227
  144. <https://github.com/zopefoundation/zope.interface/issues/227>`_.
  145. - Add the method ``BaseAdapterRegistry.rebuild()``. This can be used
  146. to fix the reference counting issue mentioned above, as well as to
  147. update the data structures when custom data types have changed.
  148. - Add the interface method ``IAdapterRegistry.subscribed()`` and
  149. implementation ``BaseAdapterRegistry.subscribed()`` for querying
  150. directly registered subscribers. See `issue 230
  151. <https://github.com/zopefoundation/zope.interface/issues/230>`_.
  152. - Add the maintenance method
  153. ``Components.rebuildUtilityRegistryFromLocalCache()``. Most users
  154. will not need this, but it can be useful if the ``Components.utilities``
  155. registry is suspected to be out of sync with the ``Components``
  156. object itself (this might happen to persistent ``Components``
  157. implementations in the face of bugs).
  158. - Fix the ``Provides`` and ``ClassProvides`` descriptors to stop
  159. allowing redundant interfaces (those already implemented by the
  160. underlying class or meta class) to produce an inconsistent
  161. resolution order. This is similar to the change in ``@implementer``
  162. in 5.1.0, and resolves inconsistent resolution orders with
  163. ``zope.proxy`` and ``zope.location``. See `issue 207
  164. <https://github.com/zopefoundation/zope.interface/issues/207>`_.
  165. 5.2.0 (2020-11-05)
  166. ==================
  167. - Add documentation section ``Persistency and Equality``
  168. (`#218 <https://github.com/zopefoundation/zope.interface/issues/218>`_).
  169. - Create arm64 wheels.
  170. - Add support for Python 3.9.
  171. 5.1.2 (2020-10-01)
  172. ==================
  173. - Make sure to call each invariant only once when validating invariants.
  174. Previously, invariants could be called multiple times because when an
  175. invariant is defined in an interface, it's found by in all interfaces
  176. inheriting from that interface. See `pull request 215
  177. <https://github.com/zopefoundation/zope.interface/pull/215/>`_.
  178. 5.1.1 (2020-09-30)
  179. ==================
  180. - Fix the method definitions of ``IAdapterRegistry.subscribe``,
  181. ``subscriptions`` and ``subscribers``. Previously, they all were
  182. defined to accept a ``name`` keyword argument, but subscribers have
  183. no names and the implementation of that interface did not accept
  184. that argument. See `issue 208
  185. <https://github.com/zopefoundation/zope.interface/issues/208>`_.
  186. - Fix a potential reference leak in the C optimizations. Previously,
  187. applications that dynamically created unique ``Specification``
  188. objects (e.g., used ``@implementer`` on dynamic classes) could
  189. notice a growth of small objects over time leading to increased
  190. garbage collection times. See `issue 216
  191. <https://github.com/zopefoundation/zope.interface/issues/216>`_.
  192. .. caution::
  193. This leak could prevent interfaces used as the bases of
  194. other interfaces from being garbage collected. Those interfaces
  195. will now be collected.
  196. One way in which this would manifest was that ``weakref.ref``
  197. objects (and things built upon them, like
  198. ``Weak[Key|Value]Dictionary``) would continue to have access to
  199. the original object even if there were no other visible
  200. references to Python and the original object *should* have been
  201. collected. This could be especially problematic for the
  202. ``WeakKeyDictionary`` when combined with dynamic or local
  203. (created in the scope of a function) interfaces, since interfaces
  204. are hashed based just on their name and module name. See the
  205. linked issue for an example of a resulting ``KeyError``.
  206. Note that such potential errors are not new, they are just once
  207. again a possibility.
  208. 5.1.0 (2020-04-08)
  209. ==================
  210. - Make ``@implementer(*iface)`` and ``classImplements(cls, *iface)``
  211. ignore redundant interfaces. If the class already implements an
  212. interface through inheritance, it is no longer redeclared
  213. specifically for *cls*. This solves many instances of inconsistent
  214. resolution orders, while still allowing the interface to be declared
  215. for readability and maintenance purposes. See `issue 199
  216. <https://github.com/zopefoundation/zope.interface/issues/199>`_.
  217. - Remove all bare ``except:`` statements. Previously, when accessing
  218. special attributes such as ``__provides__``, ``__providedBy__``,
  219. ``__class__`` and ``__conform__``, this package wrapped such access
  220. in a bare ``except:`` statement, meaning that many errors could pass
  221. silently; typically this would result in a fallback path being taken
  222. and sometimes (like with ``providedBy()``) the result would be
  223. non-sensical. This is especially true when those attributes are
  224. implemented with descriptors. Now, only ``AttributeError`` is
  225. caught. This makes errors more obvious.
  226. Obviously, this means that some exceptions will be propagated
  227. differently than before. In particular, ``RuntimeError`` raised by
  228. Acquisition in the case of circular containment will now be
  229. propagated. Previously, when adapting such a broken object, a
  230. ``TypeError`` would be the common result, but now it will be a more
  231. informative ``RuntimeError``.
  232. In addition, ZODB errors like ``POSKeyError`` could now be
  233. propagated where previously they would ignored by this package.
  234. See `issue 200 <https://github.com/zopefoundation/zope.interface/issues/200>`_.
  235. - Require that the second argument (*bases*) to ``InterfaceClass`` is
  236. a tuple. This only matters when directly using ``InterfaceClass`` to
  237. create new interfaces dynamically. Previously, an individual
  238. interface was allowed, but did not work correctly. Now it is
  239. consistent with ``type`` and requires a tuple.
  240. - Let interfaces define custom ``__adapt__`` methods. This implements
  241. the other side of the :pep:`246` adaptation protocol: objects being
  242. adapted could already implement ``__conform__`` if they know about
  243. the interface, and now interfaces can implement ``__adapt__`` if
  244. they know about particular objects. There is no performance penalty
  245. for interfaces that do not supply custom ``__adapt__`` methods.
  246. This includes the ability to add new methods, or override existing
  247. interface methods using the new ``@interfacemethod`` decorator.
  248. See `issue 3 <https://github.com/zopefoundation/zope.interface/issues/3>`_.
  249. - Make the internal singleton object returned by APIs like
  250. ``implementedBy`` and ``directlyProvidedBy`` for objects that
  251. implement or provide no interfaces more immutable. Previously an
  252. internal cache could be mutated. See `issue 204
  253. <https://github.com/zopefoundation/zope.interface/issues/204>`_.
  254. 5.0.2 (2020-03-30)
  255. ==================
  256. - Ensure that objects that implement no interfaces (such as direct
  257. subclasses of ``object``) still include ``Interface`` itself in
  258. their ``__iro___`` and ``__sro___``. This fixes adapter registry
  259. lookups for such objects when the adapter is registered for
  260. ``Interface``. See `issue 197
  261. <https://github.com/zopefoundation/zope.interface/issues/197>`_.
  262. 5.0.1 (2020-03-21)
  263. ==================
  264. - Ensure the resolution order for ``InterfaceClass`` is consistent.
  265. See `issue 192 <https://github.com/zopefoundation/zope.interface/issues/192>`_.
  266. - Ensure the resolution order for ``collections.OrderedDict`` is
  267. consistent on CPython 2. (It was already consistent on Python 3 and PyPy).
  268. - Fix the handling of the ``ZOPE_INTERFACE_STRICT_IRO`` environment
  269. variable. Previously, ``ZOPE_INTERFACE_STRICT_RO`` was read, in
  270. contrast with the documentation. See `issue 194
  271. <https://github.com/zopefoundation/zope.interface/issues/194>`_.
  272. 5.0.0 (2020-03-19)
  273. ==================
  274. - Make an internal singleton object returned by APIs like
  275. ``implementedBy`` and ``directlyProvidedBy`` immutable. Previously,
  276. it was fully mutable and allowed changing its ``__bases___``. That
  277. could potentially lead to wrong results in pathological corner
  278. cases. See `issue 158
  279. <https://github.com/zopefoundation/zope.interface/issues/158>`_.
  280. - Support the ``PURE_PYTHON`` environment variable at runtime instead
  281. of just at wheel build time. A value of 0 forces the C extensions to
  282. be used (even on PyPy) failing if they aren't present. Any other
  283. value forces the Python implementation to be used, ignoring the C
  284. extensions. See `PR 151 <https://github.com/zopefoundation/zope.interface/pull/151>`_.
  285. - Cache the result of ``__hash__`` method in ``InterfaceClass`` as a
  286. speed optimization. The method is called very often (i.e several
  287. hundred thousand times during Plone 5.2 startup). Because the hash value never
  288. changes it can be cached. This improves test performance from 0.614s
  289. down to 0.575s (1.07x faster). In a real world Plone case a reindex
  290. index came down from 402s to 320s (1.26x faster). See `PR 156
  291. <https://github.com/zopefoundation/zope.interface/pull/156>`_.
  292. - Change the C classes ``SpecificationBase`` and its subclass
  293. ``ClassProvidesBase`` to store implementation attributes in their structures
  294. instead of their instance dictionaries. This eliminates the use of
  295. an undocumented private C API function, and helps make some
  296. instances require less memory. See `PR 154 <https://github.com/zopefoundation/zope.interface/pull/154>`_.
  297. - Reduce memory usage in other ways based on observations of usage
  298. patterns in Zope (3) and Plone code bases.
  299. - Specifications with no dependents are common (more than 50%) so
  300. avoid allocating a ``WeakKeyDictionary`` unless we need it.
  301. - Likewise, tagged values are relatively rare, so don't allocate a
  302. dictionary to hold them until they are used.
  303. - Use ``__slots___`` or the C equivalent ``tp_members`` in more
  304. common places. Note that this removes the ability to set arbitrary
  305. instance variables on certain objects.
  306. See `PR 155 <https://github.com/zopefoundation/zope.interface/pull/155>`_.
  307. The changes in this release resulted in a 7% memory reduction after
  308. loading about 6,000 modules that define about 2,200 interfaces.
  309. .. caution::
  310. Details of many private attributes have changed, and external use
  311. of those private attributes may break. In particular, the
  312. lifetime and default value of ``_v_attrs`` has changed.
  313. - Remove support for hashing uninitialized interfaces. This could only
  314. be done by subclassing ``InterfaceClass``. This has generated a
  315. warning since it was first added in 2011 (3.6.5). Please call the
  316. ``InterfaceClass`` constructor or otherwise set the appropriate
  317. fields in your subclass before attempting to hash or sort it. See
  318. `issue 157 <https://github.com/zopefoundation/zope.interface/issues/157>`_.
  319. - Remove unneeded override of the ``__hash__`` method from
  320. ``zope.interface.declarations.Implements``. Watching a reindex index
  321. process in ZCatalog with on a Py-Spy after 10k samples the time for
  322. ``.adapter._lookup`` was reduced from 27.5s to 18.8s (~1.5x faster).
  323. Overall reindex index time shrunk from 369s to 293s (1.26x faster).
  324. See `PR 161
  325. <https://github.com/zopefoundation/zope.interface/pull/161>`_.
  326. - Make the Python implementation closer to the C implementation by
  327. ignoring all exceptions, not just ``AttributeError``, during (parts
  328. of) interface adaptation. See `issue 163
  329. <https://github.com/zopefoundation/zope.interface/issues/163>`_.
  330. - Micro-optimization in ``.adapter._lookup`` , ``.adapter._lookupAll``
  331. and ``.adapter._subscriptions``: By loading ``components.get`` into
  332. a local variable before entering the loop a bytcode "LOAD_FAST 0
  333. (components)" in the loop can be eliminated. In Plone, while running
  334. all tests, average speedup of the "owntime" of ``_lookup`` is ~5x.
  335. See `PR 167
  336. <https://github.com/zopefoundation/zope.interface/pull/167>`_.
  337. - Add ``__all__`` declarations to all modules. This helps tools that
  338. do auto-completion and documentation and results in less cluttered
  339. results. Wildcard ("*") are not recommended and may be affected. See
  340. `issue 153
  341. <https://github.com/zopefoundation/zope.interface/issues/153>`_.
  342. - Fix ``verifyClass`` and ``verifyObject`` for builtin types like
  343. ``dict`` that have methods taking an optional, unnamed argument with
  344. no default value like ``dict.pop``. On PyPy3, the verification is
  345. strict, but on PyPy2 (as on all versions of CPython) those methods
  346. cannot be verified and are ignored. See `issue 118
  347. <https://github.com/zopefoundation/zope.interface/issues/118>`_.
  348. - Update the common interfaces ``IEnumerableMapping``,
  349. ``IExtendedReadMapping``, ``IExtendedWriteMapping``,
  350. ``IReadSequence`` and ``IUniqueMemberWriteSequence`` to no longer
  351. require methods that were removed from Python 3 on Python 3, such as
  352. ``__setslice___``. Now, ``dict``, ``list`` and ``tuple`` properly
  353. verify as ``IFullMapping``, ``ISequence`` and ``IReadSequence,``
  354. respectively on all versions of Python.
  355. - Add human-readable ``__str___`` and ``__repr___`` to ``Attribute``
  356. and ``Method``. These contain the name of the defining interface
  357. and the attribute. For methods, it also includes the signature.
  358. - Change the error strings raised by ``verifyObject`` and
  359. ``verifyClass``. They now include more human-readable information
  360. and exclude extraneous lines and spaces. See `issue 170
  361. <https://github.com/zopefoundation/zope.interface/issues/170>`_.
  362. .. caution:: This will break consumers (such as doctests) that
  363. depended on the exact error messages.
  364. - Make ``verifyObject`` and ``verifyClass`` report all errors, if the
  365. candidate object has multiple detectable violations. Previously they
  366. reported only the first error. See `issue
  367. <https://github.com/zopefoundation/zope.interface/issues/171>`_.
  368. Like the above, this will break consumers depending on the exact
  369. output of error messages if more than one error is present.
  370. - Add ``zope.interface.common.collections``,
  371. ``zope.interface.common.numbers``, and ``zope.interface.common.io``.
  372. These modules define interfaces based on the ABCs defined in the
  373. standard library ``collections.abc``, ``numbers`` and ``io``
  374. modules, respectively. Importing these modules will make the
  375. standard library concrete classes that are registered with those
  376. ABCs declare the appropriate interface. See `issue 138
  377. <https://github.com/zopefoundation/zope.interface/issues/138>`_.
  378. - Add ``zope.interface.common.builtins``. This module defines
  379. interfaces of common builtin types, such as ``ITextString`` and
  380. ``IByteString``, ``IDict``, etc. These interfaces extend the
  381. appropriate interfaces from ``collections`` and ``numbers``, and the
  382. standard library classes implement them after importing this module.
  383. This is intended as a replacement for third-party packages like
  384. `dolmen.builtins <https://pypi.org/project/dolmen.builtins/>`_.
  385. See `issue 138 <https://github.com/zopefoundation/zope.interface/issues/138>`_.
  386. - Make ``providedBy()`` and ``implementedBy()`` respect ``super``
  387. objects. For instance, if class ``Derived`` implements ``IDerived``
  388. and extends ``Base`` which in turn implements ``IBase``, then
  389. ``providedBy(super(Derived, derived))`` will return ``[IBase]``.
  390. Previously it would have returned ``[IDerived]`` (in general, it
  391. would previously have returned whatever would have been returned
  392. without ``super``).
  393. Along with this change, adapter registries will unpack ``super``
  394. objects into their ``__self___`` before passing it to the factory.
  395. Together, this means that ``component.getAdapter(super(Derived,
  396. self), ITarget)`` is now meaningful.
  397. See `issue 11 <https://github.com/zopefoundation/zope.interface/issues/11>`_.
  398. - Fix a potential interpreter crash in the low-level adapter
  399. registry lookup functions. See issue 11.
  400. - Adopt Python's standard `C3 resolution order
  401. <https://www.python.org/download/releases/2.3/mro/>`_ to compute the
  402. ``__iro__`` and ``__sro__`` of interfaces, with tweaks to support
  403. additional cases that are common in interfaces but disallowed for
  404. Python classes. Previously, an ad-hoc ordering that made no
  405. particular guarantees was used.
  406. This has many beneficial properties, including the fact that base
  407. interface and base classes tend to appear near the end of the
  408. resolution order instead of the beginning. The resolution order in
  409. general should be more predictable and consistent.
  410. .. caution::
  411. In some cases, especially with complex interface inheritance
  412. trees or when manually providing or implementing interfaces, the
  413. resulting IRO may be quite different. This may affect adapter
  414. lookup.
  415. The C3 order enforces some constraints in order to be able to
  416. guarantee a sensible ordering. Older versions of zope.interface did
  417. not impose similar constraints, so it was possible to create
  418. interfaces and declarations that are inconsistent with the C3
  419. constraints. In that event, zope.interface will still produce a
  420. resolution order equal to the old order, but it won't be guaranteed
  421. to be fully C3 compliant. In the future, strict enforcement of C3
  422. order may be the default.
  423. A set of environment variables and module constants allows
  424. controlling several aspects of this new behaviour. It is possible to
  425. request warnings about inconsistent resolution orders encountered,
  426. and even to forbid them. Differences between the C3 resolution order
  427. and the previous order can be logged, and, in extreme cases, the
  428. previous order can still be used (this ability will be removed in
  429. the future). For details, see the documentation for
  430. ``zope.interface.ro``.
  431. - Make inherited tagged values in interfaces respect the resolution
  432. order (``__iro__``), as method and attribute lookup does. Previously
  433. tagged values could give inconsistent results. See `issue 190
  434. <https://github.com/zopefoundation/zope.interface/issues/190>`_.
  435. - Add ``getDirectTaggedValue`` (and related methods) to interfaces to
  436. allow accessing tagged values irrespective of inheritance. See
  437. `issue 190
  438. <https://github.com/zopefoundation/zope.interface/issues/190>`_.
  439. - Ensure that ``Interface`` is always the last item in the ``__iro__``
  440. and ``__sro__``. This is usually the case, but if classes that do
  441. not implement any interfaces are part of a class inheritance
  442. hierarchy, ``Interface`` could be assigned too high a priority.
  443. See `issue 8 <https://github.com/zopefoundation/zope.interface/issues/8>`_.
  444. - Implement sorting, equality, and hashing in C for ``Interface``
  445. objects. In micro benchmarks, this makes those operations 40% to 80%
  446. faster. This translates to a 20% speed up in querying adapters.
  447. Note that this changes certain implementation details. In
  448. particular, ``InterfaceClass`` now has a non-default metaclass, and
  449. it is enforced that ``__module__`` in instances of
  450. ``InterfaceClass`` is read-only.
  451. See `PR 183 <https://github.com/zopefoundation/zope.interface/pull/183>`_.
  452. 4.7.2 (2020-03-10)
  453. ==================
  454. - Remove deprecated use of setuptools features. See `issue 30
  455. <https://github.com/zopefoundation/zope.interface/issues/30>`_.
  456. 4.7.1 (2019-11-11)
  457. ==================
  458. - Use Python 3 syntax in the documentation. See `issue 119
  459. <https://github.com/zopefoundation/zope.interface/issues/119>`_.
  460. 4.7.0 (2019-11-11)
  461. ==================
  462. - Drop support for Python 3.4.
  463. - Change ``queryTaggedValue``, ``getTaggedValue``,
  464. ``getTaggedValueTags`` in interfaces. They now include inherited
  465. values by following ``__bases__``. See `PR 144
  466. <https://github.com/zopefoundation/zope.interface/pull/144>`_.
  467. .. caution:: This may be a breaking change.
  468. - Add support for Python 3.8.
  469. 4.6.0 (2018-10-23)
  470. ==================
  471. - Add support for Python 3.7
  472. - Fix ``verifyObject`` for class objects with staticmethods on
  473. Python 3. See `issue 126
  474. <https://github.com/zopefoundation/zope.interface/issues/126>`_.
  475. 4.5.0 (2018-04-19)
  476. ==================
  477. - Drop support for 3.3, avoid accidental dependence breakage via setup.py.
  478. See `PR 110 <https://github.com/zopefoundation/zope.interface/pull/110>`_.
  479. - Allow registering and unregistering instance methods as listeners.
  480. See `issue 12 <https://github.com/zopefoundation/zope.interface/issues/12>`_
  481. and `PR 102 <https://github.com/zopefoundation/zope.interface/pull/102>`_.
  482. - Synchronize and simplify zope/__init__.py. See `issue 114
  483. <https://github.com/zopefoundation/zope.interface/issues/114>`_
  484. 4.4.3 (2017-09-22)
  485. ==================
  486. - Avoid exceptions when the ``__annotations__`` attribute is added to
  487. interface definitions with Python 3.x type hints. See `issue 98
  488. <https://github.com/zopefoundation/zope.interface/issues/98>`_.
  489. - Fix the possibility of a rare crash in the C extension when
  490. deallocating items. See `issue 100
  491. <https://github.com/zopefoundation/zope.interface/issues/100>`_.
  492. 4.4.2 (2017-06-14)
  493. ==================
  494. - Fix a regression storing
  495. ``zope.component.persistentregistry.PersistentRegistry`` instances.
  496. See `issue 85 <https://github.com/zopefoundation/zope.interface/issues/85>`_.
  497. - Fix a regression that could lead to the utility registration cache
  498. of ``Components`` getting out of sync. See `issue 93
  499. <https://github.com/zopefoundation/zope.interface/issues/93>`_.
  500. 4.4.1 (2017-05-13)
  501. ==================
  502. - Simplify the caching of utility-registration data. In addition to
  503. simplification, avoids spurious test failures when checking for
  504. leaks in tests with persistent registries. See `pull 84
  505. <https://github.com/zopefoundation/zope.interface/pull/84>`_.
  506. - Raise ``ValueError`` when non-text names are passed to adapter registry
  507. methods: prevents corruption of lookup caches.
  508. 4.4.0 (2017-04-21)
  509. ==================
  510. - Avoid a warning from the C compiler.
  511. (https://github.com/zopefoundation/zope.interface/issues/71)
  512. - Add support for Python 3.6.
  513. 4.3.3 (2016-12-13)
  514. ==================
  515. - Correct typos and ReST formatting errors in documentation.
  516. - Add API documentation for the adapter registry.
  517. - Ensure that the ``LICENSE.txt`` file is included in built wheels.
  518. - Fix C optimizations broken on Py3k. See the Python bug at:
  519. http://bugs.python.org/issue15657
  520. (https://github.com/zopefoundation/zope.interface/issues/60)
  521. 4.3.2 (2016-09-05)
  522. ==================
  523. - Fix equality testing of ``implementedBy`` objects and proxies.
  524. (https://github.com/zopefoundation/zope.interface/issues/55)
  525. 4.3.1 (2016-08-31)
  526. ==================
  527. - Support Components subclasses that are not hashable.
  528. (https://github.com/zopefoundation/zope.interface/issues/53)
  529. 4.3.0 (2016-08-31)
  530. ==================
  531. - Add the ability to sort the objects returned by ``implementedBy``.
  532. This is compatible with the way interface classes sort so they can
  533. be used together in ordered containers like BTrees.
  534. (https://github.com/zopefoundation/zope.interface/issues/42)
  535. - Make ``setuptools`` a hard dependency of ``setup.py``.
  536. (https://github.com/zopefoundation/zope.interface/issues/13)
  537. - Change a linear algorithm (O(n)) in ``Components.registerUtility`` and
  538. ``Components.unregisterUtility`` into a dictionary lookup (O(1)) for
  539. hashable components. This substantially improves the time taken to
  540. manipulate utilities in large registries at the cost of some
  541. additional memory usage. (https://github.com/zopefoundation/zope.interface/issues/46)
  542. 4.2.0 (2016-06-10)
  543. ==================
  544. - Add support for Python 3.5
  545. - Drop support for Python 2.6 and 3.2.
  546. 4.1.3 (2015-10-05)
  547. ==================
  548. - Fix installation without a C compiler on Python 3.5
  549. (https://github.com/zopefoundation/zope.interface/issues/24).
  550. 4.1.2 (2014-12-27)
  551. ==================
  552. - Add support for PyPy3.
  553. - Remove unittest assertions deprecated in Python3.x.
  554. - Add ``zope.interface.document.asReStructuredText``, which formats the
  555. generated text for an interface using ReST double-backtick markers.
  556. 4.1.1 (2014-03-19)
  557. ==================
  558. - Add support for Python 3.4.
  559. 4.1.0 (2014-02-05)
  560. ==================
  561. - Update ``boostrap.py`` to version 2.2.
  562. - Add ``@named(name)`` declaration, that specifies the component name, so it
  563. does not have to be passed in during registration.
  564. 4.0.5 (2013-02-28)
  565. ==================
  566. - Fix a bug where a decorated method caused false positive failures on
  567. ``verifyClass()``.
  568. 4.0.4 (2013-02-21)
  569. ==================
  570. - Fix a bug that was revealed by porting zope.traversing. During a loop, the
  571. loop body modified a weakref dict causing a ``RuntimeError`` error.
  572. 4.0.3 (2012-12-31)
  573. ==================
  574. - Fleshed out PyPI Trove classifiers.
  575. 4.0.2 (2012-11-21)
  576. ==================
  577. - Add support for Python 3.3.
  578. - Restored ability to install the package in the absence of ``setuptools``.
  579. - LP #1055223: Fix test which depended on dictionary order and failed randomly
  580. in Python 3.3.
  581. 4.0.1 (2012-05-22)
  582. ==================
  583. - Drop explicit ``DeprecationWarnings`` for "class advice" APIS (these
  584. APIs are still deprecated under Python 2.x, and still raise an exception
  585. under Python 3.x, but no longer cause a warning to be emitted under
  586. Python 2.x).
  587. 4.0.0 (2012-05-16)
  588. ==================
  589. - Automated build of Sphinx HTML docs and running doctest snippets via tox.
  590. - Deprecate the "class advice" APIs from ``zope.interface.declarations``:
  591. ``implements``, ``implementsOnly``, and ``classProvides``. In their place,
  592. prefer the equivalent class decorators: ``@implementer``,
  593. ``@implementer_only``, and ``@provider``. Code which uses the deprecated
  594. APIs will not work as expected under Py3k.
  595. - Remove use of '2to3' and associated fixers when installing under Py3k.
  596. The code is now in a "compatible subset" which supports Python 2.6, 2.7,
  597. and 3.2, including PyPy 1.8 (the version compatible with the 2.7 language
  598. spec).
  599. - Drop explicit support for Python 2.4 / 2.5 / 3.1.
  600. - Add support for PyPy.
  601. - Add support for continuous integration using ``tox`` and ``jenkins``.
  602. - Add 'setup.py dev' alias (runs ``setup.py develop`` plus installs
  603. ``nose`` and ``coverage``).
  604. - Add 'setup.py docs' alias (installs ``Sphinx`` and dependencies).
  605. - Replace all unittest coverage previously accomplished via doctests with
  606. unittests. The doctests have been moved into a ``docs`` section, managed
  607. as a Sphinx collection.
  608. - LP #910987: Ensure that the semantics of the ``lookup`` method of
  609. ``zope.interface.adapter.LookupBase`` are the same in both the C and
  610. Python implementations.
  611. - LP #900906: Avoid exceptions due to tne new ``__qualname__`` attribute
  612. added in Python 3.3 (see PEP 3155 for rationale). Thanks to Antoine
  613. Pitrou for the patch.
  614. 3.8.0 (2011-09-22)
  615. ==================
  616. - New module ``zope.interface.registry``. This is code moved from
  617. ``zope.component.registry`` which implements a basic nonperistent component
  618. registry as ``zope.interface.registry.Components``. This class was moved
  619. from ``zope.component`` to make porting systems (such as Pyramid) that rely
  620. only on a basic component registry to Python 3 possible without needing to
  621. port the entirety of the ``zope.component`` package. Backwards
  622. compatibility import shims have been left behind in ``zope.component``, so
  623. this change will not break any existing code.
  624. - New ``tests_require`` dependency: ``zope.event`` to test events sent by
  625. Components implementation. The ``zope.interface`` package does not have a
  626. hard dependency on ``zope.event``, but if ``zope.event`` is importable, it
  627. will send component registration events when methods of an instance of
  628. ``zope.interface.registry.Components`` are called.
  629. - New interfaces added to support ``zope.interface.registry.Components``
  630. addition: ``ComponentLookupError``, ``Invalid``, ``IObjectEvent``,
  631. ``ObjectEvent``, ``IComponentLookup``, ``IRegistration``,
  632. ``IUtilityRegistration``, ``IAdapterRegistration``,
  633. ``ISubscriptionAdapterRegistration``, ``IHandlerRegistration``,
  634. ``IRegistrationEvent``, ``RegistrationEvent``, ``IRegistered``,
  635. ``Registered``, ``IUnregistered``, ``Unregistered``,
  636. ``IComponentRegistry``, and ``IComponents``.
  637. - No longer Python 2.4 compatible (tested under 2.5, 2.6, 2.7, and 3.2).
  638. 3.7.0 (2011-08-13)
  639. ==================
  640. - Move changes from 3.6.2 - 3.6.5 to a new 3.7.x release line.
  641. 3.6.7 (2011-08-20)
  642. ==================
  643. - Fix sporadic failures on x86-64 platforms in tests of rich comparisons
  644. of interfaces.
  645. 3.6.6 (2011-08-13)
  646. ==================
  647. - LP #570942: Now correctly compare interfaces from different modules but
  648. with the same names.
  649. N.B.: This is a less intrusive / destabilizing fix than the one applied in
  650. 3.6.3: we only fix the underlying cmp-alike function, rather than adding
  651. the other "rich comparison" functions.
  652. - Revert to software as released with 3.6.1 for "stable" 3.6 release branch.
  653. 3.6.5 (2011-08-11)
  654. ==================
  655. - LP #811792: work around buggy behavior in some subclasses of
  656. ``zope.interface.interface.InterfaceClass``, which invoke ``__hash__``
  657. before initializing ``__module__`` and ``__name__``. The workaround
  658. returns a fixed constant hash in such cases, and issues a ``UserWarning``.
  659. - LP #804832: Under PyPy, ``zope.interface`` should not build its C
  660. extension. Also, prevent attempting to build it under Jython.
  661. - Add a tox.ini for easier xplatform testing.
  662. - Fix testing deprecation warnings issued when tested under Py3K.
  663. 3.6.4 (2011-07-04)
  664. ==================
  665. - LP 804951: InterfaceClass instances were unhashable under Python 3.x.
  666. 3.6.3 (2011-05-26)
  667. ==================
  668. - LP #570942: Now correctly compare interfaces from different modules but
  669. with the same names.
  670. 3.6.2 (2011-05-17)
  671. ==================
  672. - Moved detailed documentation out-of-line from PyPI page, linking instead to
  673. http://docs.zope.org/zope.interface .
  674. - Fixes for small issues when running tests under Python 3.2 using
  675. ``zope.testrunner``.
  676. - LP # 675064: Specify return value type for C optimizations module init
  677. under Python 3: undeclared value caused warnings, and segfaults on some
  678. 64 bit architectures.
  679. - setup.py now raises RuntimeError if you don't have Distutils installed when
  680. running under Python 3.
  681. 3.6.1 (2010-05-03)
  682. ==================
  683. - A non-ASCII character in the changelog made 3.6.0 uninstallable on
  684. Python 3 systems with another default encoding than UTF-8.
  685. - Fix compiler warnings under GCC 4.3.3.
  686. 3.6.0 (2010-04-29)
  687. ==================
  688. - LP #185974: Clear the cache used by ``Specificaton.get`` inside
  689. ``Specification.changed``. Thanks to Jacob Holm for the patch.
  690. - Add support for Python 3.1. Contributors:
  691. Lennart Regebro
  692. Martin v Loewis
  693. Thomas Lotze
  694. Wolfgang Schnerring
  695. The 3.1 support is completely backwards compatible. However, the implements
  696. syntax used under Python 2.X does not work under 3.X, since it depends on
  697. how metaclasses are implemented and this has changed. Instead it now supports
  698. a decorator syntax (also under Python 2.X)::
  699. class Foo:
  700. implements(IFoo)
  701. ...
  702. can now also be written::
  703. @implementer(IFoo):
  704. class Foo:
  705. ...
  706. There are 2to3 fixers available to do this change automatically in the
  707. zope.fixers package.
  708. - Python 2.3 is no longer supported.
  709. 3.5.4 (2009-12-23)
  710. ==================
  711. - Use the standard Python doctest module instead of zope.testing.doctest, which
  712. has been deprecated.
  713. 3.5.3 (2009-12-08)
  714. ==================
  715. - Fix an edge case: make providedBy() work when a class has '__provides__' in
  716. its __slots__ (see http://thread.gmane.org/gmane.comp.web.zope.devel/22490)
  717. 3.5.2 (2009-07-01)
  718. ==================
  719. - BaseAdapterRegistry.unregister, unsubscribe: Remove empty portions of
  720. the data structures when something is removed. This avoids leaving
  721. references to global objects (interfaces) that may be slated for
  722. removal from the calling application.
  723. 3.5.1 (2009-03-18)
  724. ==================
  725. - verifyObject: use getattr instead of hasattr to test for object attributes
  726. in order to let exceptions other than AttributeError raised by properties
  727. propagate to the caller
  728. - Add Sphinx-based documentation building to the package buildout
  729. configuration. Use the ``bin/docs`` command after buildout.
  730. - Improve package description a bit. Unify changelog entries formatting.
  731. - Change package's mailing list address to zope-dev at zope.org as
  732. zope3-dev at zope.org is now retired.
  733. 3.5.0 (2008-10-26)
  734. ==================
  735. - Fix declaration of _zope_interface_coptimizations, it's not a top level
  736. package.
  737. - Add a DocTestSuite for odd.py module, so their tests are run.
  738. - Allow to bootstrap on Jython.
  739. - Fix https://bugs.launchpad.net/zope3/3.3/+bug/98388: ISpecification
  740. was missing a declaration for __iro__.
  741. - Add optional code optimizations support, which allows the building
  742. of C code optimizations to fail (Jython).
  743. - Replace `_flatten` with a non-recursive implementation, effectively making
  744. it 3x faster.
  745. 3.4.1 (2007-10-02)
  746. ==================
  747. - Fix a setup bug that prevented installation from source on systems
  748. without setuptools.
  749. 3.4.0 (2007-07-19)
  750. ==================
  751. - Final release for 3.4.0.
  752. 3.4.0b3 (2007-05-22)
  753. ====================
  754. - When checking whether an object is already registered, use identity
  755. comparison, to allow adding registering with picky custom comparison methods.
  756. 3.3.0.1 (2007-01-03)
  757. ====================
  758. - Made a reference to OverflowWarning, which disappeared in Python
  759. 2.5, conditional.
  760. 3.3.0 (2007/01/03)
  761. ==================
  762. New Features
  763. ------------
  764. - Refactor the adapter-lookup algorithim to make it much simpler and faster.
  765. Also, implement more of the adapter-lookup logic in C, making
  766. debugging of application code easier, since there is less
  767. infrastructre code to step through.
  768. - Treat objects without interface declarations as if they
  769. declared that they provide ``zope.interface.Interface``.
  770. - Add a number of richer new adapter-registration interfaces
  771. that provide greater control and introspection.
  772. - Add a new interface decorator to zope.interface that allows the
  773. setting of tagged values on an interface at definition time (see
  774. zope.interface.taggedValue).
  775. Bug Fixes
  776. ---------
  777. - A bug in multi-adapter lookup sometimes caused incorrect adapters to
  778. be returned.
  779. 3.2.0.2 (2006-04-15)
  780. ====================
  781. - Fix packaging bug: 'package_dir' must be a *relative* path.
  782. 3.2.0.1 (2006-04-14)
  783. ====================
  784. - Packaging change: suppress inclusion of 'setup.cfg' in 'sdist' builds.
  785. 3.2.0 (2006-01-05)
  786. ==================
  787. - Corresponds to the version of the zope.interface package shipped as part of
  788. the Zope 3.2.0 release.
  789. 3.1.0 (2005-10-03)
  790. ==================
  791. - Corresponds to the version of the zope.interface package shipped as part of
  792. the Zope 3.1.0 release.
  793. - Made attribute resolution order consistent with component lookup order,
  794. i.e. new-style class MRO semantics.
  795. - Deprecate 'isImplementedBy' and 'isImplementedByInstancesOf' APIs in
  796. favor of 'implementedBy' and 'providedBy'.
  797. 3.0.1 (2005-07-27)
  798. ==================
  799. - Corresponds to the version of the zope.interface package shipped as part of
  800. the Zope X3.0.1 release.
  801. - Fix a bug reported by James Knight, which caused adapter registries
  802. to fail occasionally to reflect declaration changes.
  803. 3.0.0 (2004-11-07)
  804. ==================
  805. - Corresponds to the version of the zope.interface package shipped as part of
  806. the Zope X3.0.0 release.