summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* performance: store cached hashvalue in slot (~1.6x faster)hash-performanceJens W. Klein2020-02-173-3/+11
|
* Merge pull request #177 from zopefoundation/fix-signatureJens W. Klein2020-02-163-5/+6
|\ | | | | Fix repr of "Attribute" to look like before
| * Fix repr of "Attribute" to look like beforeJens W. Klein2020-02-163-5/+6
| | | | | | | | and as usual in Python.
* | Merge pull request #176 from zopefoundation/issue6Jason Madden2020-02-151-1/+50
|\ \ | |/ |/| Add test case for #6.
| * Add test case for #6.issue6Jason Madden2020-02-141-1/+50
|/ | | | It seems to be working now, so this fixes #6
* Merge pull request #174 from zopefoundation/issue171Jason Madden2020-02-107-159/+562
|\ | | | | Make verifyObject/Class collect and raise all errors instead of only the first
| * One more place needing python -mJason Madden2020-02-101-2/+2
| |
| * Attempt workaround for virtualenv 20.0 failures.Jason Madden2020-02-101-4/+9
| | | | | | | | See https://github.com/zopefoundation/zope.interface/pull/174#issuecomment-584154877
| * Simplify the string formatting rules for the Invalid exceptions.Jason Madden2020-02-104-116/+326
| | | | | | | | | | | | 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.
| * Make verifyObject/Class collect and raise all errors instead of only the first.issue171Jason Madden2020-02-086-108/+296
|/ | | | Fixes #171.
* Merge pull request #173 from zopefoundation/issue170Jason Madden2020-02-089-103/+368
|\ | | | | Make verification errors more readable and useful.
| * Add warning to change note about string changes breaking doctests.Jason Madden2020-02-085-27/+69
| | | | | | | | Also tweak documentation to DRY for verifyObject/verifyClass.
| * Also document the not-a-method case.issue170Jason Madden2020-02-072-1/+9
| |
| * Make verification errors more readable and useful.Jason Madden2020-02-077-77/+292
|/ | | | | | | | | | | | | | 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
* Merge pull request #172 from zopefoundation/issue118Jason Madden2020-02-077-46/+177
|\ | | | | Fix verification for methods of builtin types with pseudo-default args on PyPy
| * Fix verification for methods of builtin types with pseudo-default arguments ↵issue118Jason Madden2020-02-067-46/+177
|/ | | | | | | | | on Pypy On PyPy2, they are ignored (like on CPython), but on PyPy3 they can actually be validated. Fixes #118
* Merge pull request #169 from zopefoundation/issue153Jason Madden2020-02-0611-46/+130
|\ | | | | Add __all__ to all modules.
| * Correct extra underscore.Jason Madden2020-02-061-1/+1
| |
| * Add __all__ to all modules.issue153Jason Madden2020-02-0511-46/+130
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #167 from zopefoundation/lookup-performanceJens W. Klein2020-02-042-6/+21
|\ | | | | Performance optimization in _lookup _lookupAll and _subscriptions
| * better namingJens W. Klein2020-02-041-9/+9
| |
| * iPerformace optimization in _lookup _lookupAll _subscriptionslookup-performanceJens W. Klein2020-02-042-6/+21
|/
* Merge pull request #164 from zopefoundation/issue162Jason Madden2020-02-044-15/+55
|\ | | | | The _empty singleton has no-op subscribe/unsubscribe methods.
| * The _empty singleton has no-op subscribe/unsubscribe methods.issue162Jason Madden2020-01-284-15/+55
|/ | | | | | | | 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.
* Merge pull request #161 from zopefoundation/hash_performance_2Jens W. Klein2020-01-282-5/+9
|\ | | | | Remove unneeded overwrite and call to anyway inherited __hash__ method
| * apply suggestion by @jmadden to enhance commentJens W. Klein2020-01-281-2/+2
| |
| * Remove unneeded overwrite and call to anyway inherited __hash__ methodhash_performance_2Jens W. Klein2020-01-282-3/+7
|/
* Merge pull request #160 from zopefoundation/issue158Jason Madden2020-01-273-3/+114
|\ | | | | Make the singleton _empty immutable.
| * Add comment detailing why __bases__ can be set per review.issue158Jason Madden2020-01-271-1/+7
| |
| * Make the singleton _empty immutable.Jason Madden2020-01-273-3/+108
|/ | | | Fixes #158
* Merge pull request #159 from zopefoundation/issue157Jason Madden2020-01-274-20/+16
|\ | | | | Remove support for hashing uninitialized interfaces.
| * Remove support for hashing uninitialized interfaces.issue157Jason Madden2020-01-274-20/+16
|/ | | | Fixes #157
* Merge pull request #155 from zopefoundation/slotsJason Madden2020-01-276-53/+144
|\ | | | | More memory optimizations for a 6-7% reduction.
| * Whitespace.Jason Madden2020-01-271-1/+1
| |
| * Avoid allocating space for tagged values unless they're used. This saves ↵Jason Madden2020-01-272-9/+28
| | | | | | | | another few percent.
| * Specifications with no dependents are common (4700 out of 7000 in this ↵Jason Madden2020-01-272-13/+29
| | | | | | | | | | | | example), so avoid allocating a WeakKeyDictionary until needed. This saves another 2% or so.
| * Move Declaration, Specification and ClassProvides to __slots__.Jason Madden2020-01-275-37/+93
|/ | | | 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.
* Merge pull request #156 from zopefoundation/hash_performanceJens W. Klein2020-01-272-5/+16
|\ | | | | Improve InterfaceClass __hash__ performance
| * cache on volatile attribute in case class is persisted in ZODBhash_performanceJens W. Klein2020-01-251-3/+3
| |
| * Improve InterfaceClass __hash__ performanceJens W. Klein2020-01-242-5/+16
|/
* Add PR links to CHANGES.rst for #151 and #154. [skip ci]Jason Madden2020-01-231-2/+3
|
* Merge pull request #154 from zopefoundation/c-opts-membersJason Madden2020-01-235-232/+280
|\ | | | | Use tp_members in SpecificationBase and ClassProvidesBase; stop using private undoc API
| * Use tp_members in SpecificationBase and ClassProvidesBase.Jason Madden2020-01-235-232/+280
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #151 from zopefoundation/no-pure-python-buildJason Madden2020-01-2218-435/+477
|\ \ | |/ | | Remove checking of PURE_PYTHON at build time
| * Bump version as suggested in review.no-pure-python-buildJason Madden2020-01-223-2/+3
| | | | | | | | Also add a line of missing whitespace.
| * Tweaks for coverage reporting.Jason Madden2020-01-213-18/+24
| | | | | | | | And tox. It wasn't properly working to report coverage before.
| * Test PURE_PYTHON at runtime.Jason Madden2020-01-2114-324/+426
| | | | | | | | | | | | | | 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.
| * Remove unused test files.Jason Madden2020-01-213-67/+0
| |
| * Stop using deprecated setup.py test functionality.Jason Madden2020-01-213-6/+4
| |
| * Remove checking of PURE_PYTHON at build time.Jason Madden2020-01-211-4/+6
| |