Is it possible in Python to copy an object of a custom class on assignment?
Meaning,
a = b
would effectively do
a = copy.copy(b)
, where a is a new variable, and b an instance of the custom class.
I guess there might be a customization function such as __assign__
, but i didn't find anything in the operator-to-function table at the bottom of this page.