Message392176
One solution I thought of was to return not an object of the same instance, but one of the same dataclass, which would allow the implementation to traverse the class hierachy of the object and create an instance of the first dataclass-class (or class with same __init__ signature) it finds with the changes applied.
This would at least allow using replace instead of it just failing in more cases.
But according to the PEP
> Creates a new object of the same type of [the] instance
the returned object has to have the same type. |
|
Date |
User |
Action |
Args |
2021-04-28 09:56:14 | SebastianSpeitel | set | recipients:
+ SebastianSpeitel, eric.smith |
2021-04-28 09:56:14 | SebastianSpeitel | set | messageid: <1619603774.32.0.102140847794.issue43965@roundup.psfhosted.org> |
2021-04-28 09:56:14 | SebastianSpeitel | link | issue43965 messages |
2021-04-28 09:56:14 | SebastianSpeitel | create | |
|