简单的问题:在 Python 中迭代时是否可以分配速记引用,就像这样(这不起作用):
class SomeClass:
class_dict = {0:0,1:1,2:2,3:3}
newClass = SomeClass()
for n in newClass.class_dict as thedict: # assigning a shorthand reference "thedict" to newClass.class_dict
print(thedict[n])