summaryrefslogtreecommitdiff
path: root/src/zope/interface/__init__.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2020-04-03 09:55:43 -0500
committerJason Madden <jamadden@gmail.com>2020-04-06 09:14:45 -0500
commit10eadd6305ee57910dbcc508b293f4bf0364fd84 (patch)
tree63a450400cf79c33cb21a1a81d4c00371bf84dcc /src/zope/interface/__init__.py
parent1af83ef9f90aa7a558314892b72eec6d62263981 (diff)
downloadzope-interface-issue3.tar.gz
Let interface 'subclasses' override __adapt__.issue3
Cooperate with InterfaceClass to ensure there is no performance penalty for this. Fixes #3 +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | Benchmark | bench_master38 | bench_issue3 | bench_issue3_opt | +=============================================================+================+==============================+==============================+ | call interface (provides; deep) | 369 ns | 454 ns: 1.23x slower (+23%) | not significant | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (provides; wide) | 373 ns | 457 ns: 1.22x slower (+22%) | 365 ns: 1.02x faster (-2%) | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (no alternate, no conform, not provided) | 671 ns | 760 ns: 1.13x slower (+13%) | 636 ns: 1.06x faster (-5%) | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (alternate, no conform, not provided) | 395 ns | 494 ns: 1.25x slower (+25%) | not significant | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (no alternate, valid conform, not provided) | 250 ns | not significant | 227 ns: 1.10x faster (-9%) | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (alternate, invalid conform, not provided) | 348 ns | 424 ns: 1.22x slower (+22%) | not significant | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+
Diffstat (limited to 'src/zope/interface/__init__.py')
-rw-r--r--src/zope/interface/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/zope/interface/__init__.py b/src/zope/interface/__init__.py
index e282fbd..3372103 100644
--- a/src/zope/interface/__init__.py
+++ b/src/zope/interface/__init__.py
@@ -49,7 +49,7 @@ The package has several public modules:
See the module doc strings for more information.
"""
__docformat__ = 'restructuredtext'
-
+# pylint:disable=wrong-import-position,unused-import
from zope.interface.interface import Interface
from zope.interface.interface import _wire
@@ -75,8 +75,11 @@ from zope.interface.declarations import named
from zope.interface.declarations import noLongerProvides
from zope.interface.declarations import providedBy
from zope.interface.declarations import provider
+
from zope.interface.exceptions import Invalid
+
from zope.interface.interface import Attribute
+from zope.interface.interface import interfacemethod
from zope.interface.interface import invariant
from zope.interface.interface import taggedValue