Message331914
I'm not sure if this is intended behavior or an error. I'm creating dataclasses dynamically and trying to pickle those classes or objects containing instances of those classes. This was resulting in an error, so I trimmed it down to this example.
```
import pickle as pk
import dataclasses as dc
@dc.dataclass
class A:
pass
pk.dumps(A) # --> this is fine
B = dc.make_dataclass('B', [], bases=(A,))
pk.dumps(B) # --> results in an error
# PicklingError: Can't pickle <class 'types.B'>: attribute lookup B on types failed
```
is this expected behavior? and if so, is there a way to create a dynamic dataclass that pickles? |
|
Date |
User |
Action |
Args |
2018-12-16 03:22:21 | satra | set | recipients:
+ satra |
2018-12-16 03:22:21 | satra | set | messageid: <1544930541.77.0.788709270274.issue35510@psf.upfronthosting.co.za> |
2018-12-16 03:22:21 | satra | link | issue35510 messages |
2018-12-16 03:22:20 | satra | create | |
|