[issue35761] Allow dataclasses to be updated in place

2019-01-18 Thread Théophile Chevalier
Théophile Chevalier added the comment: I cannot do self.position = obj because I have references on position elsewhere. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35761] Allow dataclasses to be updated in place

2019-01-18 Thread Théophile Chevalier
Théophile Chevalier added the comment: I understand your points, I'll give an example with a simplified version of my problem: import dataclasses import othermodule # is an external dependency @dataclass class City: name: str position: othermodule.Point # Point is a data

[issue35761] Allow dataclasses to be updated in place

2019-01-17 Thread Théophile Chevalier
New submission from Théophile Chevalier : Calling dataclasses.replace(instance, **changes) returns a new object of the same type. >From my understanding there is, however, no method to update in place fields >of a dataclass from another one. I propose to add dataclasses.

[issue35710] Make dataclasses.field() accept another name for __init__ field's name

2019-01-17 Thread Théophile Chevalier
Change by Théophile Chevalier : -- nosy: +theophile ___ Python tracker <https://bugs.python.org/issue35710> ___ ___ Python-bugs-list mailing list Unsubscribe: