In my case:
I want to have IThisPackageContentLayer before IOriginalLayer. How can I cange the layers order?
I have an upgrade step for importing browserlayer.xml (where I have only IThisPackageContentLayer). Can I make this layer to be prioritized against IOriginalLayer?
The code below shows an example how to change the iro (= "Interface Resolution Order"):
from zope.interface import Interface, alsoProvides
class I1(Interface): pass
class I2(Interface): pass
class C(object): pass
c.__provides__ = type(c.__provides__)(
*((I2,) + tuple(i for i in c.__provides__.__iro__ if i is not I2))
If you define IThisPackageContentLayer as a subclass of IOriginalLayer, it will be considered to have higher precedence and thus be listed earlier in the resolution order:
Thank you, @dieter.
This is awesome. It solved my problem.
Thank you very much, @davisagli.
I spent a lot of time trying to fix this. You saved my day.
__mro__ was a good idea, and should be repeated. (?)