skulpt / skulpt

Skulpt is a Javascript implementation of the Python programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple inheritance for builtin classes doesn't work when it should

s-cork opened this issue · comments

commented

Most of the time it shouldn't work

e.g. you can't just inherit from str and dict

>>> class A(str, dict): pass
TypeError: multiple bases have instance lay-out conflict

But at the moment we tar all builtin classes with the same brush. Even when it should work.
Specifically for Errors classes

>>> class A(TypeError, ValueError): pass
TypeError: multiple bases have instance lay-out conflict
# This should be allowed - it is in cpython

We'd need to fix this before addressing #1341