Add item assignment support for 'RelationData' object #817
Labels
24.10
feature
New feature or request
investigate
Needs further investigation - do we want to do this?
It is common to see the following relation data update patterns in charm code:
However, attempting to assign relation data in a "single source of truth" approach like so
errors out with
TypeError: 'RelationData' object does not support item assignment
, and indeed__set_item__
isn't implemented.It could be handy if it was possible to overwrite the entire thing, instead of relying on
update
+ manual tidying up of leftovers.That being said, NOT supporting item assignments may have the advantage of preventing unintentional overwrites in some cases.
The text was updated successfully, but these errors were encountered: