B t `Q@s dddZdedfddZdS)NcCs<|dkr|j}Gddd|j}t|||||_t||S)a Add a method to a class: self - the object that is modified method - a function name - a string that describes the new method name Adapted from code submitted by Moshe Zadka to the ActiveState Programmer Network http://aspn.activestate.com Nc@s eZdZdS)zadd_method..newN)__name__ __module__ __qualname__rr8/tmp/pip-unpacked-wheel-cqckmaqz/pyutilib/misc/method.pynewsr)r __class__setattrgetattr)selfmethodnamerrrr add_method s  r cCst|t||||dS)a Add a method to a class given a function class self - the object that is modified method_name - the name of a function name - a string that describes the new method name globals - the global dictionary locals - the local dictionary Adapted from code submitted by Moshe Zadka to the ActiveState Programmer Network http://aspn.activestate.com N)r eval)r method_namer globalslocalsrrradd_method_by_name!sr)N)r rrrrrr s