summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zope/interface/adapter.py9
-rw-r--r--src/zope/interface/declarations.py3
-rw-r--r--src/zope/interface/interface.py2
-rw-r--r--src/zope/interface/tests/test_adapter.py7
4 files changed, 16 insertions, 5 deletions
diff --git a/src/zope/interface/adapter.py b/src/zope/interface/adapter.py
index 8242b6b..b9836d9 100644
--- a/src/zope/interface/adapter.py
+++ b/src/zope/interface/adapter.py
@@ -234,12 +234,15 @@ class BaseAdapterRegistry(object):
Remove the item *to_remove* from the (non-``None``, non-empty)
*existing_leaf_sequence* and return the mutated sequence.
- Subclasses that redefine `_leafSequenceType` should override
- this method.
-
If there is more than one item that is equal to *to_remove*
they must all be removed.
+ Subclasses that redefine `_leafSequenceType` should override
+ this method. Note that they can call this method to help
+ in their implementation; this implementation will always
+ return a new tuple constructed by iterating across
+ the *existing_leaf_sequence* and omitting items equal to *to_remove*.
+
:param existing_leaf_sequence:
As for `_addValueToLeaf`, probably an instance of
`_leafSequenceType` but possibly an older type; never `None`.
diff --git a/src/zope/interface/declarations.py b/src/zope/interface/declarations.py
index 9a0146c..1b2328e 100644
--- a/src/zope/interface/declarations.py
+++ b/src/zope/interface/declarations.py
@@ -1040,7 +1040,8 @@ def moduleProvides(*interfaces):
# XXX: is this a fossil? Nobody calls it, no unit tests exercise it, no
# doctests import it, and the package __init__ doesn't import it.
-# (Answer: Versions of zope.container prior to 4.4.0 called this.)
+# (Answer: Versions of zope.container prior to 4.4.0 called this,
+# and zope.proxy.decorator up through at least 4.3.5 called this.)
def ObjectSpecification(direct, cls):
"""Provide object specifications
diff --git a/src/zope/interface/interface.py b/src/zope/interface/interface.py
index d100aae..e3d67ae 100644
--- a/src/zope/interface/interface.py
+++ b/src/zope/interface/interface.py
@@ -425,7 +425,7 @@ class Specification(SpecificationBase):
# some bases that DO implement an interface, and some that DO
# NOT. In such a mixed scenario, you wind up with a set of
# bases to consider that look like this: [[..., Interface],
- # [..., object], ...]. Depending on the order if inheritance,
+ # [..., object], ...]. Depending on the order of inheritance,
# Interface can wind up before or after object, and that can
# happen at any point in the tree, meaning Interface can wind
# up somewhere in the middle of the order. Since Interface is
diff --git a/src/zope/interface/tests/test_adapter.py b/src/zope/interface/tests/test_adapter.py
index a80e4f1..2412f41 100644
--- a/src/zope/interface/tests/test_adapter.py
+++ b/src/zope/interface/tests/test_adapter.py
@@ -799,6 +799,13 @@ class BaseAdapterRegistryTests(unittest.TestCase):
class CustomTypesBaseAdapterRegistryTests(BaseAdapterRegistryTests):
+ """
+ This class may be extended by other packages to test their own
+ adapter registries that use custom types. (So be cautious about
+ breaking changes.)
+
+ One known user is ``zope.component.persistentregistry``.
+ """
def _getMappingType(self):
return CustomMapping