- 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 | mjpieters |
|---|---|
| Recipients | Epic_Wink, dplepage, eric.smith, kgustyr, mjpieters, remi.lapeyre, xtreak, Кирилл Чуркин |
| Date | 2019-12-05.15:44:44 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1575560684.84.0.975321811892.issue36077@roundup.psfhosted.org> |
| In-reply-to |
| Content |
|---|
I've supported people hitting this issue before (see https://stackoverflow.com/a/53085935/100297, where I used a series of mixin classes to make use of the changing MRO when the mixins share base classes, to enforce a field order from inherited classes. I'd be very much in favour of dataclasses using the attrs approach to field order: any field named in a base class *moves to the end*, so you can 'insert' your own fields by repeating parent fields that need to come later: @attr.s(auto_attribs=True) class Parent: foo: str bar: int baz: bool = False @attr.s(auto_attribs=True) class Child(Parent): spam: str baz: bool = False The above gives you a `Child(foo: str, bar: int, spam: str, baz: bool = False)` object, note that `baz` moved to the end of the arguments. `dataclasses` currently doesn't do this, so it'd be a breaking change. |
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-12-05 15:44:44 | mjpieters | set | recipients: + mjpieters, eric.smith, remi.lapeyre, xtreak, Кирилл Чуркин, Epic_Wink, kgustyr, dplepage |
| 2019-12-05 15:44:44 | mjpieters | set | messageid: <1575560684.84.0.975321811892.issue36077@roundup.psfhosted.org> |
| 2019-12-05 15:44:44 | mjpieters | link | issue36077 messages |
| 2019-12-05 15:44:44 | mjpieters | create |
Powered by Roundup Copyright © 1990-2022, Python Software Foundation
Legal Statements
