summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Support Components subclasses that are not hashable. (#54)Jason Madden2016-08-312-11/+31
| | | | | * Support Components subclasses that are not hashable. Fixes #53.
* Fix comment.Jason Madden2016-08-301-1/+1
|
* Better naming, and incorporate feedback from @prsephtonJason Madden2016-08-221-18/+19
|
* Use dictionary lookups for testing subscribed status.Jason Madden2016-08-192-74/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #46. Benchmarks show a dramatic improvement; not quite as good as the demonstration in #46 because the implementation had to be a bit more complex to properly handle unregistration, but still very good. Here it is with 20,000 items already registered: ``` %time add_to_reg(reg, 1000) CPU times: user 190 ms, sys: 19.3 ms, total: 209 ms Wall time: 203 ms ``` Here's a profile with about 100,000 utilities registered: ``` %prun add_to_reg(reg, 1000) 80005 function calls (79005 primitive calls) in 0.713 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 1000 0.596 0.001 0.621 0.001 adapter.py:202(subscribe) 12000 0.016 0.000 0.019 0.000 interface.py:518(__hash__) 1000 0.010 0.000 0.709 0.001 registry.py:206(registerUtility) 3000/2000 0.009 0.000 0.014 0.000 interface.py:255(interfaces) 2000 0.008 0.000 0.022 0.000 adapter.py:637(changed) 1000 0.008 0.000 0.025 0.000 registry.py:498(_getUtilityProvided) 9000 0.008 0.000 0.017 0.000 {method 'get' of 'dict' objects} 1000 0.008 0.000 0.027 0.000 adapter.py:102(register) 2000 0.006 0.000 0.008 0.000 adapter.py:450(changed) 1000 0.005 0.000 0.663 0.001 registry.py:145(registerUtility) ``` I was very careful not to change the pickle at all. zope.interface and zope.component tests have been run and both pass. (It was necessary to account for the underlying objects changing because of the way zope.component cleans up after tests.)
* Make declarations.Implements sortable.comp-implementsJason Madden2016-08-034-13/+103
| | | | Fixes #42
* Remove the _u compat function.literalsJason Madden2016-08-028-222/+214
| | | | | | Since we no longer support 3.2 we can use the literal syntax. This was done with a quick sed script.
* Remove duplicated linesGil Forcada2015-03-151-4/+0
| | | Commit https://github.com/zopefoundation/zope.interface/commit/bc3b946593fa204b1969d8785b58418adaa19c80 duplicated some lines on branch merge.
* Remove deprecated unittest assertions.Tres Seaver2014-12-278-742/+669
|
* 100% branch coverage.Tres Seaver2014-12-092-3/+3
| | | | | | 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.
* Normalize imports.Tres Seaver2014-12-091-3/+3
|
* 100% branch coverage for 'zope.interface.ro'.Tres Seaver2014-12-082-17/+127
|
* 100% branch coverage for 'zope.interface.registry'.Tres Seaver2014-12-081-15/+94
|
* 100% branch coverage for 'zope.interface.interface'.Tres Seaver2014-12-081-23/+45
|
* Remove fossilized 'InterfaceClass.deferred()'.Tres Seaver2014-12-081-28/+1
|
* 100% branch coverage for 'zope.interface.declarations'.Tres Seaver2014-12-082-6/+7
|
* 100% branch coverage for 'zope.interface.adapter'.Tres Seaver2014-12-082-9/+110
|
* Changed name to asReStructuredText for CamelCase correctness.Michael McNeil Forbes2014-10-302-16/+16
|
* Added new function asreStructuredTest to keep backward compatibilityMichael McNeil Forbes2014-10-292-19/+261
| | | | | - To keep code clean, functionality is implemented in asStructuredText with an added flag rst with default value False to preserve behaviour.
* Merge remote-tracking branch 'origin/patch-2' into patch-1Michael McNeil Forbes2014-10-291-24/+24
|\
| * Updated tests.Michael McNeil Forbes2014-10-291-24/+24
| |
* | Fix typo.Michael McNeil Forbes2014-10-291-1/+1
| |
* | Place code in ``code`` formatting.Michael McNeil Forbes2014-10-291-4/+4
|/ | | | | | | With the previous version of the code, function signatures etc. get inserted as plain text. A common python construct ``f(**kw)`` thus generates error since structured text thinks this is the start of **bold** text, but then complains because the start tag ``**`` is never closed. The solution here is to place all code in double hash tags so it is formatted verbatim without interpreting characters as inline markup. (Technically, this might only be supported by reStructuredText, but since this is the standard for python documentation, that is probably fine.
* The imports are alphabetically sorted.Stephan Richter2014-02-051-1/+1
|
* Added ``@named(name)`` declaration.Stephan Richter2014-02-045-10/+103
| | | | | | | The decorator specifies the component name, so it does not have to be passed in during registration. This in turn allows developers to define component names once globally and use it everywhere, especially when using ZCML where the name had to be specified a second time.
* Fixed a verifyClass false positive with a decorated method.Albertas Agejevas2013-02-282-0/+27
| | | | | This bug was a reason (?) for a gratuitous fork of the _verify function in z3c.testing.verify.
* - Fixed a bug that was revealed by porting zope.traversing. During a loop, theStephan Richter2013-02-211-1/+1
| | | | loop body modified a weakref dict causing a ``RuntimeError`` error
* - LP #1055223: Fix test which depended on dictionary order and failed randomlyBrian Sutherland2012-09-281-2/+2
| | | | | in Python 3.3.
* Repository policy.Tres Seaver2012-06-182-2/+2
|
* Drop explicit DeprecationWarnings for "class advice" APISTres Seaver2012-05-222-28/+9
| | | | | | | These APIs are still deprecated under Python 2.x, and still raise an exception under Python 3.x, but no longer cause a warning to be emitted under Python 2.x.
* further simplify some attribute lookupsFred Drake2012-04-063-4/+4
|
* Drop unneeded compatibility shims for method / function attributes.Tres Seaver2012-04-064-18/+5
| | | | | '__code__', '__defaults__', '__func__', and '__self__' all work fine on Python 2.6+.
* Deprecated the "class advice" APIs from ``zope.interface.declarations``.Tres Seaver2012-04-062-47/+98
| | | | | | | | | Code which uses the deprecated APIs will not work as expected under Py3k. Instead of ``implements``, ``implementsOnly``, or ``classProvides``, prefer the equivalent class decorators: ``@implementer``, ``@implementer_only``, and ``@provider``.
* Improve the error raised by the class advice APIs when invoked under Py3k.Tres Seaver2012-04-061-3/+14
|
* Re-silence Py3k whines.Tres Seaver2012-04-061-31/+44
|
* Close Py3k coverage gap to absolute minimum.Tres Seaver2012-04-066-36/+206
| | | | | We *can't* test the classAdvice stuff under Py3k. Need to deprecate it before the 4.0 release.
* Coverage under Py3k.Tres Seaver2012-04-062-6/+3
|
* 100% coverage under Python 2.x.Tres Seaver2012-04-061-0/+67
|
* Move commented-out doctest snippets into API docs as real snippets.Tres Seaver2012-04-063-710/+74
|
* Guard against possible failure under hash-randomizing Pythons.Tres Seaver2012-04-051-2/+2
|
* Silence Py3k whining.Tres Seaver2012-04-053-16/+16
|
* Restore 'adapter_hooks' after patching for test purposes.Tres Seaver2012-04-051-3/+7
|