""" Since foo is a global, you can delete it from the global definitions: """ def delete_func(func): del globals()[func.func_name]