Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declaration.__add__ easily produces inconsistent RO #193

Closed
jamadden opened this issue Mar 20, 2020 · 1 comment · Fixed by #238
Closed

Declaration.__add__ easily produces inconsistent RO #193

jamadden opened this issue Mar 20, 2020 · 1 comment · Fixed by #238
Assignees
Labels

Comments

@jamadden
Copy link
Member

Noticed while working on zopefoundation/zope.schema#80.

It simply takes itself as the __bases__, and whatever is unique to its second argument it tacked on, ignoring their relative order. If the two arguments partially overlap, this is almost guaranteed to produce an inconsistent RO.

@jamadden jamadden added the bug label Mar 20, 2020
@jamadden jamadden self-assigned this Apr 1, 2021
@jamadden
Copy link
Member Author

jamadden commented Apr 1, 2021

This is an example of the kind of thing that would fail in strict C3 mode:

from zope.interface import Interface
from zope.interface import implementedBy
from zope.interface import implementer

class IBase(Interface):
    pass

class IDerived(IBase):
    pass

@implementer(IBase)
class Base(object):
    pass

d = implementedBy(Base) + IDerived

jamadden added a commit that referenced this issue Apr 1, 2021
…orders.

By moving things from the RHS to the front of the list if they already extend something from the LHS.

Fixes #193
jamadden added a commit that referenced this issue Apr 1, 2021
…orders.

By moving things from the RHS to the front of the list if they already extend something from the LHS.

Fixes #193
jamadden added a commit that referenced this issue Apr 1, 2021
…orders.

By moving things from the RHS to the front of the list if they already extend something from the LHS.

Fixes #193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant