在使用循环之前是否有必要检查列表是否为空?
import bpy list = [] if len(list): # is it better to remove this line? for each in list: print(each)
编写代码以提高可读性和清晰度。在您有理由相信某段代码是代码中的瓶颈之前,请不要担心优化。我保证你检查列表的长度不是代码中的瓶颈。