Browse Source

Intermediate changes

robot-piglet 6 months ago
parent
commit
05f1a7bca5

+ 43 - 13
contrib/python/zope.interface/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: zope.interface
-Version: 6.4.post2
+Version: 7.0.3
 Summary: Interfaces for Python
 Home-page: https://github.com/zopefoundation/zope.interface
 Author: Zope Foundation and Contributors
@@ -13,7 +13,6 @@ Classifier: License :: OSI Approved :: Zope Public License
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
@@ -23,21 +22,21 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Framework :: Zope :: 3
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Requires-Python: >=3.7
+Requires-Python: >=3.8
 License-File: LICENSE.txt
 Requires-Dist: setuptools
 Provides-Extra: docs
-Requires-Dist: Sphinx ; extra == 'docs'
-Requires-Dist: repoze.sphinx.autointerface ; extra == 'docs'
-Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
+Requires-Dist: Sphinx; extra == "docs"
+Requires-Dist: repoze.sphinx.autointerface; extra == "docs"
+Requires-Dist: sphinx-rtd-theme; extra == "docs"
 Provides-Extra: test
-Requires-Dist: coverage >=5.0.3 ; extra == 'test'
-Requires-Dist: zope.event ; extra == 'test'
-Requires-Dist: zope.testing ; extra == 'test'
+Requires-Dist: coverage>=5.0.3; extra == "test"
+Requires-Dist: zope.event; extra == "test"
+Requires-Dist: zope.testing; extra == "test"
 Provides-Extra: testing
-Requires-Dist: coverage >=5.0.3 ; extra == 'testing'
-Requires-Dist: zope.event ; extra == 'testing'
-Requires-Dist: zope.testing ; extra == 'testing'
+Requires-Dist: coverage>=5.0.3; extra == "testing"
+Requires-Dist: zope.event; extra == "testing"
+Requires-Dist: zope.testing; extra == "testing"
 
 ====================
  ``zope.interface``
@@ -75,7 +74,38 @@ For detailed documentation, please see https://zopeinterface.readthedocs.io/en/l
  Changes
 =========
 
-6.4.post2 (unreleased)
+7.0.3 (2024-08-27)
+==================
+
+- Fix `Assertion 'memb->type == T_PYSSIZET' failed.` for Python < 3.12.
+  (`#319 <https://github.com/zopefoundation/zope.interface/issues/319>`_)
+
+
+7.0.2 (2024-08-26)
+==================
+
+- Fix reference-counting bug in C module initialization (broken in 7.0).
+  (`#316 <https://github.com/zopefoundation/zope.interface/issues/316>`_)
+
+
+7.0.1 (2024-08-06)
+==================
+
+- Fix subclassability of ``ObjectSpecificationDescriptor`` (broken in 7.0).
+  (`#312 <https://github.com/zopefoundation/zope.interface/issues/312>`_)
+
+
+7.0 (2024-08-06)
+================
+
+- Enable heap-based types (PEP 384) for Python >= 3.11.
+
+- Adopt multi-phase module initialization (PEP 489).
+
+- Drop support for Python 3.7.
+
+
+6.4.post2 (2024-05-24)
 ======================
 
 - Publish missing Windows wheels, second attempt.

+ 1 - 1
contrib/python/zope.interface/py3/ya.make

@@ -2,7 +2,7 @@
 
 PY3_LIBRARY()
 
-VERSION(6.4.post2)
+VERSION(7.0.3)
 
 LICENSE(ZPL-2.1)
 

+ 1 - 1
contrib/python/zope.interface/py3/zope/interface/__init__.py

@@ -58,7 +58,7 @@ from zope.interface.interface import _wire
 _wire()
 del _wire
 
-from zope.interface.declarations import Declaration
+from zope.interface.declarations import Declaration  # isort: skip
 # The following are to make spec pickles cleaner
 from zope.interface.declarations import Provides
 from zope.interface.declarations import alsoProvides

+ 3 - 2
contrib/python/zope.interface/py3/zope/interface/_compat.py

@@ -29,6 +29,7 @@ def _normalize_name(name):
         return name
     raise TypeError("name must be a string or ASCII-only bytes")
 
+
 PYPY = hasattr(sys, 'pypy_version_info')
 
 
@@ -57,7 +58,7 @@ def _c_optimizations_available():
     try:
         from zope.interface import _zope_interface_coptimizations as c_opt
         return c_opt
-    except catch: # pragma: no cover (only Jython doesn't build extensions)
+    except catch:  # pragma: no cover (only Jython doesn't build extensions)
         return False
 
 
@@ -120,7 +121,7 @@ def _use_c_impl(py_impl, name=None, globs=None):
             return py_impl
 
         c_opt = _c_optimizations_available()
-        if not c_opt: # pragma: no cover (only Jython doesn't build extensions)
+        if not c_opt:  # pragma: no cover (Jython doesn't build extensions)
             return py_impl
 
         __traceback_info__ = c_opt

+ 1 - 1
contrib/python/zope.interface/py3/zope/interface/_flatten.py

@@ -24,7 +24,7 @@ def _flatten(implements, include_None=0):
         r = implements.flattened()
     except AttributeError:
         if implements is None:
-            r=()
+            r = ()
         else:
             r = Declaration(implements).flattened()
 

File diff suppressed because it is too large
+ 541 - 499
contrib/python/zope.interface/py3/zope/interface/_zope_interface_coptimizations.c


+ 96 - 63
contrib/python/zope.interface/py3/zope/interface/adapter.py

@@ -59,7 +59,7 @@ __all__ = [
 # ``tuple([t fon t in range(10)])``      ->  82ns
 # ``tuple(t for t in range(10))``        -> 177ns
 # ``tuple(map(lambda t: t, range(10)))`` -> 168ns
-#
+
 
 class BaseAdapterRegistry:
     """
@@ -68,36 +68,40 @@ class BaseAdapterRegistry:
 
     Subclasses can set the following attributes to control how the data
     is stored; in particular, these hooks can be helpful for ZODB
-    persistence. They can be class attributes that are the named (or similar) type, or
-    they can be methods that act as a constructor for an object that behaves
-    like the types defined here; this object will not assume that they are type
-    objects, but subclasses are free to do so:
+    persistence. They can be class attributes that are the named
+    (or similar) type, or they can be methods that act as a constructor
+    for an object that behaves like the types defined here; this object
+    will not assume that they are type objects, but subclasses are free
+    to do so:
 
     _sequenceType = list
       This is the type used for our two mutable top-level "byorder" sequences.
-      Must support mutation operations like ``append()`` and ``del seq[index]``.
-      These are usually small (< 10). Although at least one of them is
-      accessed when performing lookups or queries on this object, the other
-      is untouched. In many common scenarios, both are only required when
-      mutating registrations and subscriptions (like what
+      Must support mutation operations like ``append()`` and ``del
+      seq[index]``.  These are usually small (< 10). Although at least one of
+      them is accessed when performing lookups or queries on this object, the
+      other is untouched. In many common scenarios, both are only required
+      when mutating registrations and subscriptions (like what
       :meth:`zope.interface.interfaces.IComponents.registerUtility` does).
       This use pattern makes it an ideal candidate to be a
       :class:`~persistent.list.PersistentList`.
+
     _leafSequenceType = tuple
       This is the type used for the leaf sequences of subscribers.
       It could be set to a ``PersistentList`` to avoid many unnecessary data
-      loads when subscribers aren't being used. Mutation operations are directed
-      through :meth:`_addValueToLeaf` and :meth:`_removeValueFromLeaf`; if you use
-      a mutable type, you'll need to override those.
+      loads when subscribers aren't being used. Mutation operations are
+      directed through :meth:`_addValueToLeaf` and
+      :meth:`_removeValueFromLeaf`; if you use a mutable type, you'll need to
+      override those.
+
     _mappingType = dict
-      This is the mutable mapping type used for the keyed mappings.
-      A :class:`~persistent.mapping.PersistentMapping`
-      could be used to help reduce the number of data loads when the registry is large
-      and parts of it are rarely used. Further reductions in data loads can come from
-      using a :class:`~BTrees.OOBTree.OOBTree`, but care is required
-      to be sure that all required/provided
-      values are fully ordered (e.g., no required or provided values that are classes
-      can be used).
+      This is the mutable mapping type used for the keyed mappings.  A
+      :class:`~persistent.mapping.PersistentMapping` could be used to help
+      reduce the number of data loads when the registry is large and parts of
+      it are rarely used. Further reductions in data loads can come from using
+      a :class:`~BTrees.OOBTree.OOBTree`, but care is required to be sure that
+      all required/provided values are fully ordered (e.g., no required or
+      provided values that are classes can be used).
+
     _providedType = dict
       This is the mutable mapping type used for the ``_provided`` mapping.
       This is separate from the generic mapping type because the values
@@ -106,9 +110,10 @@ class BaseAdapterRegistry:
       The same caveats regarding key types
       apply as for ``_mappingType``.
 
-    It is possible to also set these on an instance, but because of the need to
-    potentially also override :meth:`_addValueToLeaf` and :meth:`_removeValueFromLeaf`,
-    this may be less useful in a persistent scenario; using a subclass is recommended.
+    It is possible to also set these on an instance, but because of the need
+    to potentially also override :meth:`_addValueToLeaf` and
+    :meth:`_removeValueFromLeaf`, this may be less useful in a persistent
+    scenario; using a subclass is recommended.
 
     .. versionchanged:: 5.3.0
         Add support for customizing the way internal data
@@ -209,18 +214,20 @@ class BaseAdapterRegistry:
         Add the value *new_item* to the *existing_leaf_sequence*, which may
         be ``None``.
 
-        Subclasses that redefine `_leafSequenceType` should override this method.
+        Subclasses that redefine `_leafSequenceType` should override this
+        method.
 
         :param existing_leaf_sequence:
             If *existing_leaf_sequence* is not *None*, it will be an instance
-            of `_leafSequenceType`. (Unless the object has been unpickled
-            from an old pickle and the class definition has changed, in which case
-            it may be an instance of a previous definition, commonly a `tuple`.)
+            of `_leafSequenceType`. (Unless the object has been unpickled from
+            an old pickle and the class definition has changed, in which case
+            it may be an instance of a previous definition, commonly a
+            `tuple`.)
 
         :return:
            This method returns the new value to be stored. It may mutate the
-           sequence in place if it was not ``None`` and the type is mutable, but
-           it must also return it.
+           sequence in place if it was not ``None`` and the type is mutable,
+           but it must also return it.
 
         .. versionadded:: 5.3.0
         """
@@ -337,9 +344,9 @@ class BaseAdapterRegistry:
 
     def _all_entries(self, byorder):
         # Recurse through the mapping levels of the `byorder` sequence,
-        # reconstructing a flattened sequence of ``(required, provided, name, value)``
-        # tuples that can be used to reconstruct the sequence with the appropriate
-        # registration methods.
+        # reconstructing a flattened sequence of ``(required, provided, name,
+        # value)`` tuples that can be used to reconstruct the sequence with
+        # the appropriate registration methods.
         #
         # Locally reference the `byorder` data; it might be replaced while
         # this method is running (see ``rebuild``).
@@ -461,7 +468,9 @@ class BaseAdapterRegistry:
 
         .. versionadded:: 5.3.0
         """
-        for required, provided, _name, value in self._all_entries(self._subscribers):
+        for required, provided, _name, value in self._all_entries(
+            self._subscribers,
+        ):
             for v in value:
                 yield (required, provided, v)
 
@@ -570,7 +579,6 @@ class BaseAdapterRegistry:
         registrations = buffer(registrations)
         subscriptions = buffer(subscriptions)
 
-
         # Replace the base data structures as well as _v_lookup.
         self.__init__(self.__bases__)
         # Re-register everything previously registered and subscribed.
@@ -584,12 +592,13 @@ class BaseAdapterRegistry:
         # part of passing that notification to the change of objects.)
         for args in registrations:
             self.register(*args)
+
         for args in subscriptions:
             self.subscribe(*args)
 
-    # XXX hack to fake out twisted's use of a private api.  We need to get them
-    # to use the new registered method.
-    def get(self, _): # pragma: no cover
+    # XXX hack to fake out twisted's use of a private api.
+    # We need to get them to use the new registered method.
+    def get(self, _):  # pragma: no cover
         class XXXTwistedFakeOut:
             selfImplied = {}
         return XXXTwistedFakeOut
@@ -597,6 +606,7 @@ class BaseAdapterRegistry:
 
 _not_in_mapping = object()
 
+
 @_use_c_impl
 class LookupBase:
 
@@ -693,7 +703,6 @@ class LookupBase:
 
         return result
 
-
     def subscriptions(self, required, provided):
         cache = self._scache.get(provided)
         if cache is None:
@@ -710,33 +719,42 @@ class LookupBase:
 
 
 @_use_c_impl
-class VerifyingBase(LookupBaseFallback):
+class VerifyingBase(LookupBaseFallback):  # noqa F821
     # Mixin for lookups against registries which "chain" upwards, and
     # whose lookups invalidate their own caches whenever a parent registry
     # bumps its own '_generation' counter.  E.g., used by
     # zope.component.persistentregistry
 
     def changed(self, originally_changed):
-        LookupBaseFallback.changed(self, originally_changed)
+        LookupBaseFallback.changed(self, originally_changed)  # noqa F821
         self._verify_ro = self._registry.ro[1:]
         self._verify_generations = [r._generation for r in self._verify_ro]
 
     def _verify(self):
-        if ([r._generation for r in self._verify_ro]
-            != self._verify_generations):
+        if (
+            [
+                r._generation for r in self._verify_ro
+            ] != self._verify_generations
+        ):
             self.changed(None)
 
     def _getcache(self, provided, name):
         self._verify()
-        return LookupBaseFallback._getcache(self, provided, name)
+        return LookupBaseFallback._getcache(  # noqa F821
+            self, provided, name,
+        )
 
     def lookupAll(self, required, provided):
         self._verify()
-        return LookupBaseFallback.lookupAll(self, required, provided)
+        return LookupBaseFallback.lookupAll(  # noqa F821
+            self, required, provided,
+        )
 
     def subscriptions(self, required, provided):
         self._verify()
-        return LookupBaseFallback.subscriptions(self, required, provided)
+        return LookupBaseFallback.subscriptions(  # noqa F821
+            self, required, provided,
+        )
 
 
 class AdapterLookupBase:
@@ -755,7 +773,6 @@ class AdapterLookupBase:
                 r.unsubscribe(self)
         self._required.clear()
 
-
     # Extendors
     # ---------
 
@@ -778,7 +795,7 @@ class AdapterLookupBase:
     # the interface's __iro__ has changed.  This is unlikely enough that
     # we'll take our chances for now.
 
-    def init_extendors(self):
+    def init_extendors(self):  # noqa E301
         self._extendors = {}
         for p in self._registry._provided:
             self.add_extendor(p)
@@ -788,12 +805,14 @@ class AdapterLookupBase:
         for i in provided.__iro__:
             extendors = _extendors.get(i, ())
             _extendors[i] = (
-                [e for e in extendors if provided.isOrExtends(e)]
-                +
-                [provided]
-                +
-                [e for e in extendors if not provided.isOrExtends(e)]
-                )
+                [
+                    e for e in extendors if provided.isOrExtends(e)
+                ] + [
+                    provided
+                ] + [
+                    e for e in extendors if not provided.isOrExtends(e)
+                ]
+            )
 
     def remove_extendor(self, provided):
         _extendors = self._extendors
@@ -801,7 +820,6 @@ class AdapterLookupBase:
             _extendors[i] = [e for e in _extendors.get(i, ())
                              if e != provided]
 
-
     def _subscribe(self, *required):
         _refs = self._required
         for r in required:
@@ -838,7 +856,9 @@ class AdapterLookupBase:
         if factory is None:
             return default
 
-        result = factory(*[o.__self__ if isinstance(o, super) else o for o in objects])
+        result = factory(*[
+            o.__self__ if isinstance(o, super) else o for o in objects
+        ])
         if result is None:
             return default
 
@@ -889,7 +909,9 @@ class AdapterLookupBase:
         return result
 
     def subscribers(self, objects, provided):
-        subscriptions = self.subscriptions([providedBy(o) for o in objects], provided)
+        subscriptions = self.subscriptions(
+            [providedBy(o) for o in objects], provided
+        )
         if provided is None:
             result = ()
             for subscription in subscriptions:
@@ -902,9 +924,11 @@ class AdapterLookupBase:
                     result.append(subscriber)
         return result
 
+
 class AdapterLookup(AdapterLookupBase, LookupBase):
     pass
 
+
 @implementer(IAdapterRegistry)
 class AdapterRegistry(BaseAdapterRegistry):
     """
@@ -949,6 +973,7 @@ class AdapterRegistry(BaseAdapterRegistry):
 class VerifyingAdapterLookup(AdapterLookupBase, VerifyingBase):
     pass
 
+
 @implementer(IAdapterRegistry)
 class VerifyingAdapterRegistry(BaseAdapterRegistry):
     """
@@ -957,13 +982,15 @@ class VerifyingAdapterRegistry(BaseAdapterRegistry):
 
     LookupClass = VerifyingAdapterLookup
 
+
 def _convert_None_to_Interface(x):
     if x is None:
         return Interface
     else:
         return x
 
-def _lookup(components, specs, provided, name, i, l):
+
+def _lookup(components, specs, provided, name, i, l):  # noqa: E741
     # this function is called very often.
     # The components.get in loops is executed 100 of 1000s times.
     # by loading get into a local variable the bytecode
@@ -973,7 +1000,7 @@ def _lookup(components, specs, provided, name, i, l):
         for spec in specs[i].__sro__:
             comps = components_get(spec)
             if comps:
-                r = _lookup(comps, specs, provided, name, i+1, l)
+                r = _lookup(comps, specs, provided, name, i + 1, l)
                 if r is not None:
                     return r
     else:
@@ -986,26 +1013,32 @@ def _lookup(components, specs, provided, name, i, l):
 
     return None
 
-def _lookupAll(components, specs, provided, result, i, l):
+
+def _lookupAll(components, specs, provided, result, i, l):  # noqa: E741
     components_get = components.get  # see _lookup above
     if i < l:
         for spec in reversed(specs[i].__sro__):
             comps = components_get(spec)
             if comps:
-                _lookupAll(comps, specs, provided, result, i+1, l)
+                _lookupAll(comps, specs, provided, result, i + 1, l)
     else:
         for iface in reversed(provided):
             comps = components_get(iface)
             if comps:
                 result.update(comps)
 
-def _subscriptions(components, specs, provided, name, result, i, l):
+
+def _subscriptions(
+    components, specs, provided, name, result, i, l  # noqa: E741
+):
     components_get = components.get  # see _lookup above
     if i < l:
         for spec in reversed(specs[i].__sro__):
             comps = components_get(spec)
             if comps:
-                _subscriptions(comps, specs, provided, name, result, i+1, l)
+                _subscriptions(
+                    comps, specs, provided, name, result, i + 1, l
+                )
     else:
         for iface in reversed(provided):
             comps = components_get(iface)

+ 11 - 10
contrib/python/zope.interface/py3/zope/interface/advice.py

@@ -52,7 +52,7 @@ def getFrameInfo(frame):
     hasName = '__name__' in f_globals
 
     sameName = hasModule and hasName
-    sameName = sameName and f_globals['__name__']==f_locals['__module__']
+    sameName = sameName and f_globals['__name__'] == f_locals['__module__']
 
     module = hasName and sys.modules.get(f_globals['__name__']) or None
 
@@ -67,35 +67,36 @@ def getFrameInfo(frame):
         kind = "class"
     elif not sameNamespace:
         kind = "function call"
-    else: # pragma: no cover
-        # How can you have f_locals is f_globals, and have '__module__' set?
-        # This is probably module-level code, but with a '__module__' variable.
+    else:  # pragma: no cover
+        # How can you have f_locals is f_globals, and have '__module__'
+        # set?  # This is probably module-level code, but with a
+        # '__module__' variable.
         kind = "unknown"
     return kind, module, f_locals, f_globals
 
 
 def isClassAdvisor(ob):
     """True if 'ob' is a class advisor function"""
-    return isinstance(ob,FunctionType) and hasattr(ob,'previousMetaclass')
+    return isinstance(ob, FunctionType) and hasattr(ob, 'previousMetaclass')
 
 
 def determineMetaclass(bases, explicit_mc=None):
     """Determine metaclass from 1+ bases and optional explicit __metaclass__"""
 
-    meta = [getattr(b,'__class__',type(b)) for b in bases]
+    meta = [getattr(b, '__class__', type(b)) for b in bases]
 
     if explicit_mc is not None:
         # The explicit metaclass needs to be verified for compatibility
         # as well, and allowed to resolve the incompatible bases, if any
         meta.append(explicit_mc)
 
-    if len(meta)==1:
+    if len(meta) == 1:
         # easy case
         return meta[0]
 
-    candidates = minimalBases(meta) # minimal set of metaclasses
+    candidates = minimalBases(meta)  # minimal set of metaclasses
 
-    if len(candidates)>1:
+    if len(candidates) > 1:
         # We could auto-combine, but for now we won't...
         raise TypeError("Incompatible metatypes", bases)
 
@@ -109,7 +110,7 @@ def minimalBases(classes):
 
     for m in classes:
         for n in classes:
-            if issubclass(n,m) and m is not n:
+            if issubclass(n, m) and m is not n:
                 break
         else:
             # m has no subclasses in 'classes'

+ 35 - 17
contrib/python/zope.interface/py3/zope/interface/common/__init__.py

@@ -24,11 +24,11 @@ __all__ = [
     # Nothing public here.
 ]
 
-
 # pylint:disable=inherit-non-class,
 # pylint:disable=no-self-argument,no-method-argument
 # pylint:disable=unexpected-special-method-signature
 
+
 class optional:
     # Apply this decorator to a method definition to make it
     # optional (remove it from the list of required names), overriding
@@ -115,8 +115,9 @@ class ABCInterfaceClass(InterfaceClass):
     """
 
     # If we could figure out invalidation, and used some special
-    # Specification/Declaration instances, and override the method ``providedBy`` here,
-    # perhaps we could more closely integrate with ABC virtual inheritance?
+    # Specification/Declaration instances, and override the method
+    # ``providedBy`` here, perhaps we could more closely integrate with ABC
+    # virtual inheritance?
 
     def __init__(self, name, bases, attrs):
         # go ahead and give us a name to ease debugging.
@@ -128,7 +129,9 @@ class ABCInterfaceClass(InterfaceClass):
             # Something like ``IList(ISequence)``: We're extending
             # abc interfaces but not an ABC interface ourself.
             InterfaceClass.__init__(self, name, bases, attrs)
-            ABCInterfaceClass.__register_classes(self, extra_classes, ignored_classes)
+            ABCInterfaceClass.__register_classes(
+                self, extra_classes, ignored_classes,
+            )
             self.__class__ = InterfaceClass
             return
 
@@ -143,8 +146,9 @@ class ABCInterfaceClass(InterfaceClass):
             # e.g., ``__ror__ = __or__``.
             k: self.__method_from_function(v, k)
             for k, v in vars(based_on).items()
-            if isinstance(v, FunctionType) and not self.__is_private_name(k)
-            and not self.__is_reverse_protocol_name(k)
+            if isinstance(v, FunctionType) and
+            not self.__is_private_name(k) and
+            not self.__is_reverse_protocol_name(k)
         }
 
         methods['__doc__'] = self.__create_class_doc(attrs)
@@ -163,12 +167,13 @@ class ABCInterfaceClass(InterfaceClass):
             return ''
 
         docs = "\n\nThe following methods are optional:\n - " + "\n-".join(
-            "{}\n{}".format(k, v.__doc__) for k, v in optionals.items()
+            f"{k}\n{v.__doc__}" for k, v in optionals.items()
         )
         return docs
 
     def __create_class_doc(self, attrs):
         based_on = self.__abc
+
         def ref(c):
             mod = c.__module__
             name = c.__name__
@@ -176,13 +181,16 @@ class ABCInterfaceClass(InterfaceClass):
                 return "`%s`" % name
             if mod == '_io':
                 mod = 'io'
-            return "`{}.{}`".format(mod, name)
+            return f"`{mod}.{name}`"
+
         implementations_doc = "\n - ".join(
             ref(c)
             for c in sorted(self.getRegisteredConformers(), key=ref)
         )
         if implementations_doc:
-            implementations_doc = "\n\nKnown implementations are:\n\n - " + implementations_doc
+            implementations_doc = (
+                "\n\nKnown implementations are:\n\n - " + implementations_doc
+            )
 
         based_on_doc = (based_on.__doc__ or '')
         based_on_doc = based_on_doc.splitlines()
@@ -196,7 +204,6 @@ class ABCInterfaceClass(InterfaceClass):
         )
         return doc
 
-
     @staticmethod
     def __is_private_name(name):
         if name.startswith('__') and name.endswith('__'):
@@ -221,8 +228,14 @@ class ABCInterfaceClass(InterfaceClass):
     def __register_classes(self, conformers=None, ignored_classes=None):
         # Make the concrete classes already present in our ABC's registry
         # declare that they implement this interface.
-        conformers = conformers if conformers is not None else self.getRegisteredConformers()
-        ignored = ignored_classes if ignored_classes is not None else self.__ignored_classes
+        conformers = (
+            conformers if conformers is not None
+            else self.getRegisteredConformers()
+        )
+        ignored = (
+            ignored_classes if ignored_classes is not None
+            else self.__ignored_classes
+        )
         for cls in conformers:
             if cls in ignored:
                 continue
@@ -246,7 +259,9 @@ class ABCInterfaceClass(InterfaceClass):
         # of checking that, so its quite possible that registrations
         # are in fact ignored, winding up just in the _abc_cache.
         try:
-            registered = list(based_on._abc_registry) + list(based_on._abc_cache)
+            registered = (
+                list(based_on._abc_registry) + list(based_on._abc_cache)
+            )
         except AttributeError:
             # Rewritten in C in CPython 3.7.
             # These expose the underlying weakref.
@@ -261,13 +276,16 @@ class ABCInterfaceClass(InterfaceClass):
 
 
 def _create_ABCInterface():
-    # It's a two-step process to create the root ABCInterface, because
-    # without specifying a corresponding ABC, using the normal constructor
-    # gets us a plain InterfaceClass object, and there is no ABC to associate with the
+    # It's a two-step process to create the root ABCInterface, because without
+    # specifying a corresponding ABC, using the normal constructor gets us a
+    # plain InterfaceClass object, and there is no ABC to associate with the
     # root.
     abc_name_bases_attrs = ('ABCInterface', (Interface,), {})
-    instance = ABCInterfaceClass.__new__(ABCInterfaceClass, *abc_name_bases_attrs)
+    instance = ABCInterfaceClass.__new__(
+        ABCInterfaceClass, *abc_name_bases_attrs,
+    )
     InterfaceClass.__init__(instance, *abc_name_bases_attrs)
     return instance
 
+
 ABCInterface = _create_ABCInterface()

+ 5 - 2
contrib/python/zope.interface/py3/zope/interface/common/builtins.py

@@ -35,6 +35,7 @@ __all__ = [
     'IFile',
 ]
 
+
 # pylint:disable=no-self-argument
 class IList(collections.IMutableSequence):
     """
@@ -86,6 +87,8 @@ class INativeString(ITextString):
     On all Python versions, this is :class:`str`. Tt extends
     :class:`ITextString`.
     """
+
+
 # We're not extending ABCInterface so extra_classes won't work
 classImplements(str, INativeString)
 
@@ -108,8 +111,8 @@ class IFile(io.IIOBase):
     """
     Interface for :class:`file`.
 
-    It is recommended to use the interfaces from :mod:`zope.interface.common.io`
-    instead of this interface.
+    It is recommended to use the interfaces from
+    :mod:`zope.interface.common.io` instead of this interface.
 
     On Python 3, there is no single implementation of this interface;
     depending on the arguments, the :func:`open` builtin can return

Some files were not shown because too many files changed in this diff