NodeMixin - TypeError: multiple bases have instance lay-out conflict
See original GitHub issueWorks: 2.4.3 Breaks: 2.6.0
>>> from munch import Munch
>>> from anytree import NodeMixin
>>> class MyClass(Munch, NodeMixin):
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: multiple bases have instance lay-out conflict
Where munch is https://github.com/Infinidat/munch
Googling around a bit this seems to be about conflicts in C implementations of classes on __foo__
attributes. So I did this:
>>> [k for k in dir(Munch) if k in dir(NodeMixin)]
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
but it didn’t make me feel much smarter.
Does this mean anything to you anytree peeps? I came here because obviously NodeMixin is meant to be mixed in so this feels like a bug rather than just a stupid thing I should not be attempting to do. Especially as it used to work until this version.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
TypeError: multiple bases have instance lay-out conflict
Instance lay-out conflict is a fancy way of saying that you're trying to inherit from multiple--in this case built-in--types that cannot ...
Read more >TypeError: multiple bases have instance lay-out conflict
Hi, I'm trying to figure out all pairs of builtin types that have instance lay-out conflicts. Is that easy to determine from the...
Read more >TypeError: multiple bases have instance lay-out conflict
The builtin type dict and a new-style class with slots both define custom object layouts at the C level. The C layout of...
Read more >Multiple Inheritance __slots__ problem - Python - Bytes
TypeError : multiple bases have instance lay-out conflict. I need to define slots in these classes and also need to inherit them in....
Read more >webcomponents/webcomponentsjs
@webcomponents/webcomponentsjs/webcomponents-bundle.js.map ... if elements do not have `innerHTML` on instances, then\n // templates can be patched by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
slots will be removed
Yes.
__slots__
has been added. Please try:As
__slots__
is not inherited, it might work