- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
➜
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
| Author | satra |
|---|---|
| Recipients | satra |
| Date | 2018-12-16.03:22:20 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1544930541.77.0.788709270274.issue35510@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
|---|
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? |
| History | |||
|---|---|---|---|
| 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 |
Powered by Roundup Copyright © 1990-2022, Python Software Foundation
Legal Statements
