Is there a library method to copy all the properties between two (already present) instances of the same class, in Python?
I mean, something like Apache Commons' PropertyUtilsBean.copyProperties()
python
Is there a library method to copy all the properties between two (already present) instances of the same class, in Python?
I mean, something like Apache Commons' PropertyUtilsBean.copyProperties()
Best Answer
Try
destination.__dict__.update(source.__dict__)
.