Message393151
@eric.smith Sure, here you go:
dataclass_empty.py:
```
from dataclasses import dataclass
@dataclass
class A:
pass
@dataclass(frozen=True)
class B(A):
x: int
print("42")
```
Running this on < 3.8.10:
```
$ ~/.pythonz/pythons/CPython-3.8.1/bin/python3.8 --version
Python 3.8.1
$ ~/.pythonz/pythons/CPython-3.8.1/bin/python3.8 dataclass_empty.py
42
```
And on 3.8.10:
```
$ /usr/local/opt/python@3.8/bin/python3 --version
Python 3.8.10
$ /usr/local/opt/python@3.8/bin/python3 dataclass_empty.py
Traceback (most recent call last):
File "dataclass_empty.py", line 10, in <module>
class B(A):
File "/usr/local/Cellar/python@3.8/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/dataclasses.py", line 1011, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
File "/usr/local/Cellar/python@3.8/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/dataclasses.py", line 896, in _process_class
raise TypeError('cannot inherit frozen dataclass from a '
TypeError: cannot inherit frozen dataclass from a non-frozen one
``` |
|
Date |
User |
Action |
Args |
2021-05-06 21:34:30 | ulope | set | recipients:
+ ulope, eric.smith, miss-islington, hbq1 |
2021-05-06 21:34:30 | ulope | set | messageid: <1620336870.93.0.317223525045.issue43176@roundup.psfhosted.org> |
2021-05-06 21:34:30 | ulope | link | issue43176 messages |
2021-05-06 21:34:30 | ulope | create | |
|