METADATA 40 KB

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