| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
__sro__ for caching.
In my local 'load the world' test, this went from ~7800 full C3 merges to about ~1100.
Also take steps to avoid triggering false positive warnings about changed ROs when it's *just* Interface that moved.
|
| |
|
|
|
|
| |
None of the elegant solutions mentioned in the issue worked out, so I had to brute force it.
Fixes #8
|
| |\
| |
| | |
Use C3 (mostly) to compute IRO.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #21
The 'mostly' is because interfaces are used in cases that C3 forbids;
when there's a conflict, we fallback to the legacy algorithm. It turns
out there are few conflicts (13K out of 149K total orderings in Plone).
I hoped the fix for #8 might shake out automatically, but it didn't.
Optimize the extremely common case of a __bases__ of length one.
In the benchmark, 4/5 of the interfaces and related objects have a base of length one.
Fix the bad IROs in the bundled ABC interfaces, and implement a way to get warnings or errors.
In running plone/buildout.coredev and tracking the RO requests, the
stats for equal, not equal, and inconsistent-so-fallback, I got
{'ros': 148868, 'eq': 138461, 'ne': 10407, 'inconsistent': 12934}
Add the interface module to the Attribute str.
This was extremely helpful tracking down the Plone problem; IDate is defined in multiple modules.
|
| |/
|
| |
Copy-pasted from `persistent` as suggested by @mgedmin
|
| |\
| |
| | |
Make provided/implementedBy and adapter registries respect super().
|
| | | |
|
| | |
| |
| |
| |
| | |
The DEFINE_STRING macro prevents the linter from seeing them as unused
so I temporarily redefined it to find all such variables.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The query functions now start by looking at the next class in the MRO (interfaces directly provided by the underlying object are not found).
Adapter registries automatically pick up providedBy change to start finding the correct implementations of adapters, but to make that really useful they needed to change to unpack super() arguments and pass __self__ to the factory.
Fixes #11
Unfortunately, this makes PyPy unable to build the C extensions.
Additional crash-safety for adapter lookup.
Make the C functions get the cache only after resolving the
``required`` into a tuple, in case of side-effects like...clearing the
cache. This could lead to the ``cache`` object being deallocated
before we used it.
Drop the ``tuplefy`` function in favor of a direct call to
``PySequence_Tuple``. It's what the ``tuple`` constructor would do
anyway and saves a few steps.
Make sure that getting ``providedBy(super())`` and
``implementedBy(super())`` have no side effects.
|
| | |
| |
| |
| |
| |
| |
| | |
This is intended to help us solve mysteries like
https://github.com/zopefoundation/zope.interface/issues/185#issuecomment-596994265,
where a 5.0.0.dev0 release was uploaded despite there being no git tags
pointing to the relevant commit that anyone knows about.
|
| | |
| |
| |
| |
| | |
Because the wheel you get is not accepted by PyPI, so this makes the
entire upload step fail.
|
| |/ |
|
| |\
| |
| | |
Add more common interfaces
|
| | | |
|
| | |
| |
| |
| | |
sequence interfaces.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
about ABCs and builtins.
bytearray turns out to violate that.
|
| |/
|
|
|
|
|
|
| |
Register implemented standard library types on import.
Derive the interface methods and documentation from the ABC automatically. I hope to use this for numbers too.
Part of #138
|
| |\
| |
| | |
Fix repr of "Attribute" to look like before
|
| | |
| |
| |
| | |
and as usual in Python.
|
| |\ \
| |/
|/| |
Add test case for #6.
|
| |/
|
|
| |
It seems to be working now, so this fixes #6
|
| |\
| |
| | |
Make verifyObject/Class collect and raise all errors instead of only the first
|
| | | |
|
| | |
| |
| |
| | |
See https://github.com/zopefoundation/zope.interface/pull/174#issuecomment-584154877
|
| | |
| |
| |
| |
| |
| | |
As per review.
Also include the actual failing implementation object in the BrokenMethodImplementation to make it easier to track down what's going on when inheritance is involved.
|
| |/
|
|
| |
Fixes #171.
|
| |\
| |
| | |
Make verification errors more readable and useful.
|
| | |
| |
| |
| | |
Also tweak documentation to DRY for verifyObject/verifyClass.
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Eliminate the trailing newlines and blank spaces (the code called them
"a stupid artifact").
Include the name of the defining interface (so the user can easily look up
any requirements on the attribute) and, for methods, the expected
signature (no more guessing about how many arguments are required!).
This is implemented by giving Attribute and Method useful reprs and strs.
Previously, they just had the defaults.
Fixes #170
|
| |\
| |
| | |
Fix verification for methods of builtin types with pseudo-default args on PyPy
|
| |/
|
|
|
|
|
|
|
| |
on Pypy
On PyPy2, they are ignored (like on CPython), but on PyPy3 they can
actually be validated.
Fixes #118
|
| |\
| |
| | |
Add __all__ to all modules.
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #153
The items that went in each ``__all__`` are based on what is
documented:
$ rg --no-filename 'import' docs/ -trst | tr -s "[:blank:]" | sort | uniq | grep zope
>>> from pprint import pprint
>>> from zope.interface import *
>>> from zope.interface import Interface
>>> from zope.interface import Interface, Attribute, implementer
>>> from zope.interface import alsoProvides
>>> from zope.interface import classImplements
>>> from zope.interface import classImplementsOnly
>>> from zope.interface import directlyProvidedBy
>>> from zope.interface import directlyProvides
>>> from zope.interface import implementedBy
>>> from zope.interface import implementer
>>> from zope.interface import implementer_only
>>> from zope.interface import noLongerProvides
>>> from zope.interface import providedBy
>>> from zope.interface import provider
>>> from zope.interface.adapter import AdapterRegistry
>>> from zope.interface.declarations import Declaration
>>> from zope.interface.declarations import InstanceDeclarations
>>> from zope.interface.declarations import ProvidesClass
>>> from zope.interface.declarations import named
>>> from zope.interface.exceptions import BrokenImplementation
>>> from zope.interface.exceptions import Invalid
>>> from zope.interface.interface import Specification
>>> from zope.interface.interface import adapter_hooks
>>> from zope.interface.verify import verifyObject
>>> import gc
>>> import zope.interface
And also some personal judgement about what the public API is that I'm
more than happy to have reviewed.
|
| |\
| |
| | |
Performance optimization in _lookup _lookupAll and _subscriptions
|
| | | |
|
| |/ |
|
| |\
| |
| | |
The _empty singleton has no-op subscribe/unsubscribe methods.
|
| |/
|
|
|
|
|
|
| |
Turns out they can be called in some very strange error cases. See #162 and #163 for details.
This should fix #162 (at least the provided test case, five.intid, passes now).
It also does enough work on #163 that (a) the test can be written and run in pure-python mode, which was needed to debug it and (b) five.intid runs in pure-python mode (well, with a bunch of other small hacks to Acquisition, ExtensionClass, DocumentTemplate and AccessControl), but I won't claim that it fully fixes #163. For one thing, there are no specific tests. For another, I see more such differences.
|
| |\
| |
| | |
Remove unneeded overwrite and call to anyway inherited __hash__ method
|
| | | |
|
| |/ |
|
| |\
| |
| | |
Make the singleton _empty immutable.
|
| | | |
|
| |/
|
|
| |
Fixes #158
|