这是一个简单的问题,但由于我没有找到任何答案,我想答案是否定的。不过,为了确保这一点,我想问:
在函数中处理完变量后,将变量设置为None
是否会提高python代码的效率?
例如:
def foo(fname):
temp_1, temp_2 = load_file_data(fname)
# do some processing on temp_1, temp_2
temp_1 = None
temp_2 = None
# continue with the rest of the function
如果我们在函数末尾这样做,答案会改变吗(因为我假设python本身会在那个时候这样做)?
目前没有回答
相关问题 更多 >
编程相关推荐