summaryrefslogtreecommitdiff
path: root/docs/api/declarations.rst
Commit message (Collapse)AuthorAgeFilesLines
* Make @implementer and classImplements not re-declare redundant interfaces.Jason Madden2020-04-071-7/+10
| | | | classImplementsOnly and @implementer_only can still be used to do that.
* Let interface 'subclasses' override __adapt__.issue3Jason Madden2020-04-061-0/+2
| | | | | | | | | | | | | | | | | | | | Cooperate with InterfaceClass to ensure there is no performance penalty for this. Fixes #3 +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | Benchmark | bench_master38 | bench_issue3 | bench_issue3_opt | +=============================================================+================+==============================+==============================+ | call interface (provides; deep) | 369 ns | 454 ns: 1.23x slower (+23%) | not significant | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (provides; wide) | 373 ns | 457 ns: 1.22x slower (+22%) | 365 ns: 1.02x faster (-2%) | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (no alternate, no conform, not provided) | 671 ns | 760 ns: 1.13x slower (+13%) | 636 ns: 1.06x faster (-5%) | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (alternate, no conform, not provided) | 395 ns | 494 ns: 1.25x slower (+25%) | not significant | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (no alternate, valid conform, not provided) | 250 ns | not significant | 227 ns: 1.10x faster (-9%) | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+ | call interface (alternate, invalid conform, not provided) | 348 ns | 424 ns: 1.22x slower (+22%) | not significant | +-------------------------------------------------------------+----------------+------------------------------+------------------------------+
* Add documentation for taggedValue and invariant.Jason Madden2020-04-061-0/+18
|
* Make Interface.getTaggedValue follow the __iro__.Jason Madden2020-03-181-5/+5
| | | | | | | | Previously it manually walked up __bases__, meaning the answers could be inconsistent. Fixes #190. Also fixes several minor issues in the documentation, mostly cross-reference related.
* Use C3 (mostly) to compute IRO.issue21Jason Madden2020-03-151-31/+137
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use .. caution:: to warn about the the old class-advice based APIsdocs-in-py3Marius Gedminas2019-11-111-3/+3
|
* Move the @provider example into the right sectionMarius Gedminas2019-11-111-9/+8
| | | | | | | | | Explain that implements()/implementsOnly()/classProvides() not only should not be "preferred", but are entirely not functional on Python 3. (These notes should probably use some Sphinx directive to stand out better, but I'm not well versed in Sphinx and I don't know which one I should use.)
* Port the documentation examples to Python 3Marius Gedminas2019-11-111-53/+76
|
* Reorganize the 'declarations' document by functional group.Jason Madden2018-07-191-489/+401
| | | | Add cross references and some formatting fixes.
* Basic API reference documentation reorg: split into four functional parts.Jason Madden2018-07-191-0/+908
Add some missing documentation for the events component registries create.