请问这里的 pile=main_box.make_a_pile_to_look_through()是什么意思

第一种方法使用的是while循环:只要盒子堆不空,就从中取一个盒子,并在其中仔细查找。

def look_for_key(main_box):
pile=main_box.make_a_pile_to_look_through()
while pile is not empty:
box=pile.grab_a_box()
for item in box:
if item.is_a_box():
pile.append(item)
elif item.is_a_key():
print "found the key!"

main_box 是个对象?
main_box.make_a_pile_to_look_through()

这里 main_box 调用了 make_a_pile_to_look_through 方法
如果是pycharm开发工具, 你可以把鼠标移动到 make_a_pile_to_look_through , 按Ctrl+B 这样就看看 make_a_pile_to_look_through 里是啥。