[Checkins] [zopefoundation/zope.interface] c2fdbe: Use C3 (mostly) to compute IRO.

Jason Madden noreply at github.com
Tue Mar 10 13:22:57 CET 2020


  Branch: refs/heads/issue21
  Home:   https://github.com/zopefoundation/zope.interface
  Commit: c2fdbe5f092229eb351908866519759f237051a8
      https://github.com/zopefoundation/zope.interface/commit/c2fdbe5f092229eb351908866519759f237051a8
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-03-10 (Tue, 10 Mar 2020)

  Changed paths:
    M CHANGES.rst
    M docs/api/declarations.rst
    M src/zope/interface/declarations.py
    M src/zope/interface/ro.py
    M src/zope/interface/tests/test_declarations.py
    M src/zope/interface/tests/test_ro.py

  Log Message:
  -----------
  Use C3 (mostly) to compute IRO.

Fixes #21

The 'mostly' is because interfaces are used in cases that C3 forbids; when there's a conflict, we move forward by adding the simple legacy base to the list at the conflicting location and continuing.

I hoped the fix for #8 might shake out automatically, but it didn't.


  Commit: ec136d8e61cafe64c04d3f3b3bb2199ae0fb8da2
      https://github.com/zopefoundation/zope.interface/commit/ec136d8e61cafe64c04d3f3b3bb2199ae0fb8da2
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-03-10 (Tue, 10 Mar 2020)

  Changed paths:
    M src/zope/interface/common/mapping.py
    M src/zope/interface/ro.py
    M src/zope/interface/tests/test_ro.py

  Log Message:
  -----------
  Remove need to use the legacy fallback.

This makes more interfaces resolvable (cuts unresolvable objects from about 130 to about 70 in my large test), and when C3 + the heuristic fails, go with the next defined base.


  Commit: f05c81181a80542417402c4b4ea09c6b2b91d5bf
      https://github.com/zopefoundation/zope.interface/commit/f05c81181a80542417402c4b4ea09c6b2b91d5bf
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-03-10 (Tue, 10 Mar 2020)

  Changed paths:
    M src/zope/interface/declarations.py
    M src/zope/interface/interface.py
    M src/zope/interface/registry.py
    M src/zope/interface/ro.py
    M src/zope/interface/tests/test_declarations.py

  Log Message:
  -----------
  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.


  Commit: acaa96f649258728b8ba6bd594c4421fcd61c850
      https://github.com/zopefoundation/zope.interface/commit/acaa96f649258728b8ba6bd594c4421fcd61c850
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-03-10 (Tue, 10 Mar 2020)

  Changed paths:
    M src/zope/interface/common/__init__.py
    M src/zope/interface/common/builtins.py
    M src/zope/interface/common/tests/__init__.py
    M src/zope/interface/common/tests/test_collections.py
    M src/zope/interface/declarations.py
    M src/zope/interface/ro.py
    M src/zope/interface/tests/test_ro.py

  Log Message:
  -----------
  Fix the bad IROs in the bundled ABC interfaces, and implement a way to get warnings or errors.


  Commit: 2349c39c801bca608fe6e7a422ac190eb13c2681
      https://github.com/zopefoundation/zope.interface/commit/2349c39c801bca608fe6e7a422ac190eb13c2681
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2020-03-10 (Tue, 10 Mar 2020)

  Changed paths:
    M src/zope/interface/common/__init__.py
    M src/zope/interface/common/collections.py
    M src/zope/interface/common/tests/__init__.py
    M src/zope/interface/ro.py

  Log Message:
  -----------
  Fix IRO consistency tests on Python 2.

basestring was messing things up. See this build:

https://travis-ci.org/zopefoundation/zope.interface/builds/660386194

For some reason, though, I didn't reproduce this at all originally.
When recreating my virtualenvironments (tox -r) I started getting it
in PyPy, but I still can't reproduce it in CPython 2.7.17. Travis is
2.7.15, but there don't seem to be any relevant changes.


Compare: https://github.com/zopefoundation/zope.interface/compare/c1e7882d202f...2349c39c801b


More information about the checkins mailing list