| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Fixes #157
|
| |
|
|
| |
another few percent.
|
| |
|
|
|
|
| |
example), so avoid allocating a WeakKeyDictionary until needed.
This saves another 2% or so.
|
| |
|
|
| |
In a test of 6000 modules that load 2245 InterfaceClass objects and produce 2233 ClassProvides instances, this saves about 1% total memory usage in Python 2.7.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Instead of storing 1 and 2 attributes, respectively, in __dict__. This lets us eliminate inst_attr and its use of an undocumented API.
It also helps reign in the size of these objects. Before, on CPython 8, a ClassProvides object that subclasses both SpecificationBase and ClassProvidesBase required 408 bytes: 48 for the object, 360 for the dict.
Now it requires 72 + 232 = 304.
With a bit of work on defining __slots__ in Python, that can be brought much lower still, I think.
zope.security tests pass with this installed.
|
| |
|
|
|
|
|
| |
Turns out that the C extensions build and work fine with PyPy, but don't use them by default. Let them
be forced, though.
Tests needed some refactoring to account for the various permutations.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Fixes #91
Remove many (or most) now-redundant 'pragma: no cover'.
A few minor test changes to get full branch coverage.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Get as close to 100% coverage as possible.
Without conflicting with #86.
This is almost entirely trivial changes:
- Make dummy methods that should never be called either raise
NotImplementedError or call self.fail() in tests.
- Standardize the no-coverage pragma
- Add a few pragmas where coverage varies across
versions/implementations, mostly for the sake of tox (travis should
hit them all).
* Convert tox to run the coverage command, like travis. A follow up should have it produce coverage for all python versions/implementations.
Fixes #87
* Adjust coverage config for py2 only tests; fix typo; finish replacing self with cls
|
| |
|
|
|
|
|
|
|
|
| |
- The bare import of '_zope_c_optimizations' prevented them from being
used.
- After enabling them via absolute imports, they would fail due to
http://bugs.python.org/issue15657.
Fixes #60.
|
| |
|
|
| |
Fixes #42
|
| |
|
|
|
|
| |
We exclude interfaces declared with the 'class' statement, because their
methods typically have only a doctstring in the suite, which confuses
the branch coverage machinery.
|
| | |
|
| |
|
|
| |
loop body modified a weakref dict causing a ``RuntimeError`` error
|
| | |
|
| |
|
|
|
| |
'__code__', '__defaults__', '__func__', and '__self__' all work fine on
Python 2.6+.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
See PEP 3155 for rationale. Thanks to Antoine Pitrou for the patch.
Fixes LP #900906.
|
| |
|
|
|
|
|
|
|
| |
Some sublcasses invoke '__hash__' before initializing '__module__' and
'__name__'. The workaround returns a fixed constant hash in such cases, and
issues a UserWarning.
Addresses LP #811792.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Fixes LP #570942.
|
| |
|
|
|
|
|
| |
Fixes LP #185974:
Thanks to Jacob Holm for the patch.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
folks depend on"
|
| |
|
|
| |
again, since getting the value for `__bases__` through `__dict__` adds up with almost 200.000 calls; of course, there's some overhead, since `__setattr__` gets called for the other attributes as well, but overall start-up is still faster
|
| | |
|
| | |
|
| |
|