Skip to content

Commit

Permalink
Adjust ISet to have the same IRO under both legacy and C3.
Browse files Browse the repository at this point in the history
Fixes a bunch of warnings importing this package with ZOPE_INTERFACE_LOG_CHANGED_IRO set.
  • Loading branch information
jamadden committed Apr 6, 2021
1 parent a007074 commit 98ffea4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ env:
PYTHONDEVMODE: 1
PYTHONFAULTHANDLER: 1
ZOPE_INTERFACE_STRICT_IRO: 1
ZOPE_INTERFACE_LOG_CHANGED_IRO: 1
# Require C extensions; this will be disabled later for
# PyPy because zope.interface through at least 5.3
# tries to import its C module even on PyPy with this, but
Expand Down
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
objects actually implemented such a method; instead, the boolean value
is typically taken from ``__len__``.

- Adjust the definition of ``ISet`` to produce the same resolution
order under the C3 and legacy orderings. This means that the legacy
order has changed slightly, but that this package emits no warnings
when ``ZOPE_INTERFACE_LOG_CHANGED_IRO=1``. Note that the legacy
order was not being used for these objects because the C3 ordering
was still consistent; it could only be obtained using
``ZOPE_INTERFACE_USE_LEGACY_IRO=1``. See `PR 159
<https://github.com/zopefoundation/BTrees/pull/159>`_ for all the
interface updates.

4.7.2 (2020-04-07)
==================

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def BTreeExtension(family):
# 4.1.0 is the first version that PURE_PYTHON can run
# ZODB tests
'persistent >= 4.1.0',
'zope.interface',
# 5.0.0 added zope.interface.common.collections
'zope.interface >= 5.0.0',
]

TESTS_REQUIRE = [
Expand Down
2 changes: 1 addition & 1 deletion src/BTrees/Interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __getitem__(index):
"""


class ISet(IKeySequence, ISetMutable):
class ISet(ISetMutable, IKeySequence):
def __and__(other):
"""Shortcut for :meth:`~BTrees.Interfaces.IMerge.intersection`"""

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ setenv =
PYTHONFAULTHANDLER=1
PYTHONDEVMODE=1
ZOPE_INTERFACE_STRICT_IRO=1
ZOPE_INTERFACE_LOG_CHANGED_IRO=1
PURE_PYTHON=0
pure: PURE_PYTHON=1
pypy: PURE_PYTHON=1
Expand Down

0 comments on commit 98ffea4

Please sign in to comment.