How to create a copy of a python function [duplicate]
问题 This question already has answers here : How can I make a deepcopy of a function in Python? (6 answers) Closed 5 years ago . Is there a possibility to create real copies of python functions? The most obvious choice was http://docs.python.org/2/library/copy.html but there I read: It does “copy” functions and classes (shallow and deeply), by returning the original object unchanged; I need a real copy, because I might change some attributes of the function. Update: I'm aware of all the