summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add comment detailing why __bases__ can be set per review.issue158Jason Madden2020-01-271-1/+7
|
* Make the singleton _empty immutable.Jason Madden2020-01-272-3/+101
| | | | Fixes #158
* Remove support for hashing uninitialized interfaces.issue157Jason Madden2020-01-272-17/+4
| | | | Fixes #157
* Whitespace.Jason Madden2020-01-271-1/+1
|
* Avoid allocating space for tagged values unless they're used. This saves ↵Jason Madden2020-01-271-3/+9
| | | | 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.
* 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-241-5/+9
|
* Use tp_members in SpecificationBase and ClassProvidesBase.Jason Madden2020-01-234-232/+275
| | | | | | | | | | | | 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.
* Bump version as suggested in review.no-pure-python-buildJason Madden2020-01-221-0/+1
| | | | Also add a line of missing whitespace.
* Tweaks for coverage reporting.Jason Madden2020-01-211-2/+2
| | | | And tox. It wasn't properly working to report coverage before.
* Test PURE_PYTHON at runtime.Jason Madden2020-01-219-260/+350
| | | | | | | 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
|
* key order doesn't mattermauro2019-10-091-1/+1
|
* fix 'dict_keys' object has no attribute 'extend'mauro2019-10-091-3/+5
|
* taggedvalue inheritancemauro2019-10-092-2/+36
|
* Fix coverage.issue126Jason Madden2018-10-231-2/+2
|
* Fix 'verifyObject' for class objects with staticmethods on Python 3.Jason Madden2018-10-232-1/+25
| | | | Fixes #126
* Reorganize the 'declarations' document by functional group.Jason Madden2018-07-192-42/+42
| | | | Add cross references and some formatting fixes.
* Formatting and cross refs for the 'Interface Specification' docJason Madden2018-07-192-26/+27
|
* Formatting and cross refs for IComponents.Jason Madden2018-07-191-114/+102
|
* Formatting for z.i.common.sequences.Jason Madden2018-07-191-22/+27
|
* Cross references and formatting for z.i.common.mappingJason Madden2018-07-191-17/+42
|
* Cross references and formatting for z.i.common.idatetime.Jason Madden2018-07-191-68/+99
|
* Add docstrings with cross-refs to z.i.common.interfacesJason Madden2018-07-191-56/+166
| | | | | | Also bring the ``classImplements`` lines closer to the interface declaration. This helped me be sure that nothing was missed and that all the repetitions of the names matched.
* Synchronize and simplify zope/__init__.pyissue114Jason Madden2018-03-081-7/+1
| | | | | | We *do* have a dependency on setuptools, so the try/except block should be unnecessary. At worst it might hide installation errors. Fixes #114.
* Allow Registering and unregistering instance methods as listeners (#102)‮rekcäH nitraM‮2017-11-282-1/+12
| | | * Fixes #12 - registering instance methods as listeners doesn’t allow to easily unregister them as the registry tries to find the handler with 'is' but it should use '==' to allow the python BoundMethod wrapper (which is a new instance every time instance.$methodname is accessed).
* I removed an unnecessary whitespace.y-fujisaki22017-09-211-1/+1
| | | Thank you for follows. I misread it for carriage return.
* Fix process of reference count during GCy-fujisaki22017-09-191-1/+3
| | | | | | call PyObject_GC_UnTrack() in tp_dealloc() see the following sites for details: * https://bugs.python.org/issue31095 * https://github.com/python/cpython/pull/2974
* Drop __annotations__ in interface declarationsMaxim Avanov2017-09-012-1/+11
|
* Merge pull request #95 from zopefoundation/combined-coverageJason Madden2017-06-1413-62/+68
|\ | | | | Enable combined coverage reports under tox and branch coverage
| * cleanups requested by @tseaver: remove assert from _implements since all its ↵Jason Madden2017-06-142-3/+5
| | | | | | | | callers already do this guard; be more explicit about ClassType in test_odd_declarations
| * Enable combined coverage reports under tox and branch coveragecombined-coverageJason Madden2017-06-1413-61/+65
| | | | | | | | | | | | | | | | Fixes #91 Remove many (or most) now-redundant 'pragma: no cover'. A few minor test changes to get full branch coverage.
* | Fix the cache getting out of sync with _utility_registrations.issue93Jason Madden2017-06-142-13/+69
|/ | | | Fixes #93
* Fix #85 by implementing __reduce__ to omit _v_ attributes.issue85-take2-reduceJason Madden2017-06-142-5/+121
| | | | | | | | | | This is an alternative to #86 and was suggested by @mgedmin in #85. There are tests to be sure this works for subclasses like Pyramid's Registry that extend dict too. This doesn't change the pickle format, we were storing the output of object.__reduce__ previously.
* 100% coverage (#90)Jason Madden2017-06-1214-271/+195
| | | | | | | | | | | | | | | | | | | | | * 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
* Test sanity cleanups (#88)Jason Madden2017-06-0816-216/+102
| | | | | | | | | | | | | | | | | | | * Test sanity cleanups Partially addresses #87 - Remove manual lists of tests in favor of loadTestsFromName. This mostly gets all test runners running the same number of tests. - Remove `additional_tests`, which was just duplicating the discovered tests. No modern test runner seems to need it. - Change the two compatibility skip decorators to actually use unitetest skips, which helps with the reporting. * Per @tseaver, drop most test_suite functions. * Port remaining doctest to unittest. * Make the odd tests work on all supported python versions
* Added some comments to describe the management of _v_utility_registrations_cachesimplify-utility-registrations-cacheJim Fulton2017-05-121-0/+7
|
* Simply the caching of utility-registration data. In addition toJim Fulton2017-05-122-43/+16
| | | | | simplification, avoids spurious test failures when checking for leaks in tests with persistent registries.
* Raise ValueError if non-text name passed to adapter registry methods.75-prevent-non-text-name-errorsTres Seaver2017-05-044-3/+82
| | | | | | Prevents corruption of lookup cache. Alternative to fix proposed in #75.
* Don't redefine METH_KEYWORDSJason Madden2017-01-051-88/+83
| | | | | | Instead, use the intended METH_KEYWORDS | METH_VARARGS spelling. Fixes #71
* Merge pull request #66 from zopefoundation/41-document-adapter-registry-apiTres Seaver2016-12-061-0/+4
|\ | | | | Document API for adapter registry.
| * Document API for adapter registry.Tres Seaver2016-12-061-0/+4
| | | | | | | | Closes: #41.
* | Fix docstring summary line for 'unregisterAdapter'.Tres Seaver2016-12-061-1/+1
|/ | | | | | Closes #23. [ci skip]
* Merge branch 'master' of github.com:zopefoundation/zope.interfaceJean Jordaan2016-12-067-12/+126
|\ | | | | | | | | | | | | Conflicts: CHANGES.rst I think that was the simplest conflict resolution ever :-]
| * Add tests asserting that optimzations are / are not present as expected.Tres Seaver2016-11-153-0/+103
| |
| * Fix C optimizations broken on Py3k.60-fix_c_optimizations-py3kTres Seaver2016-11-154-12/+23
| | | | | | | | | | | | | | | | | | | | - 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.
* | Editing while reading: literals, typos, grammarJean Jordaan2016-10-161-1/+1
|/
* Fix equality testing of implementedBy objects that have been proxied. Fixes #55.fix-55Jason Madden2016-09-022-5/+46
|