Will change the result of resource._json['title'], because they're the same object.
This is... I think surprising? And potentially dangerous if we implement write functionality at the abstraction layer.
The two things I can think of to do here are:
return copy(self._json) or deepcopy(self._json) instead of self._json
document that the user is responsible for copying. This is basically a "we're never implementing write functionality directly in the abstraction layer, you'll need to use client or a (forthcoming) separate utility module/class/whatever.
So, currently, doing e.g.
Will change the result of resource._json['title'], because they're the same object.
This is... I think surprising? And potentially dangerous if we implement write functionality at the abstraction layer.
The two things I can think of to do here are:
copy(self._json)
ordeepcopy(self._json)
instead ofself._json