Message333909
I'm don't see the point of this proposal. The fields of dataclasses are already mutable, so they can be updated just like any other object (no need for a special mechanism):
a = InventoryItem(name='Widget', unit_price=37.25, quantity_on_hand=10)
a.quantity_on_hand -= 1 # Sold one
a.unit_price *= 0.90 # Ten percent off sale
Also, it's not hard to directly take data from one instance to another:
a.name = master_catalog.name
a.unit_price = master_catalog.unit_price |
|
Date |
User |
Action |
Args |
2019-01-17 23:19:34 | rhettinger | set | recipients:
+ rhettinger, eric.smith, remi.lapeyre, theophile |
2019-01-17 23:19:32 | rhettinger | set | messageid: <1547767172.97.0.432581584599.issue35761@roundup.psfhosted.org> |
2019-01-17 23:19:32 | rhettinger | link | issue35761 messages |
2019-01-17 23:19:32 | rhettinger | create | |
|