Message403870
In Python 3.10 it is no longer possible to create an exception type that inherits from both OSError and AttributeError. This has worked in Python 3.9.
I don't see anything in changelog/release notes that would suggest it being intentional.
Behavior in Python 3.9:
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class C(OSError, AttributeError): pass
...
>>> C
<class '__main__.C'>
Behavior in Python 3.10:
Python 3.10.0 (default, Oct 4 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class C(OSError, AttributeError): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: multiple bases have instance lay-out conflict
My (very) wild guess is this being related to https://bugs.python.org/issue38530 |
|
Date |
User |
Action |
Args |
2021-10-13 20:05:16 | marmarek | set | recipients:
+ marmarek |
2021-10-13 20:05:16 | marmarek | set | messageid: <1634155516.92.0.207915157302.issue45464@roundup.psfhosted.org> |
2021-10-13 20:05:16 | marmarek | link | issue45464 messages |
2021-10-13 20:05:16 | marmarek | create | |
|