import copy class Example: def do_something(self): print("Doing a function") a = Example() b = copy.deepcopy(a); b.do_something() # >>> Doing a function