所以我得到這個錯誤Python循環導入?
Traceback (most recent call last):
File "/Users/alex/dev/runswift/utils/sim2014/simulator.py", line 3, in <module>
from world import World
File "/Users/alex/dev/runswift/utils/sim2014/world.py", line 2, in <module>
from entities.field import Field
File "/Users/alex/dev/runswift/utils/sim2014/entities/field.py", line 2, in <module>
from entities.goal import Goal
File "/Users/alex/dev/runswift/utils/sim2014/entities/goal.py", line 2, in <module>
from entities.post import Post
File "/Users/alex/dev/runswift/utils/sim2014/entities/post.py", line 4, in <module>
from physics import PostBody
File "/Users/alex/dev/runswift/utils/sim2014/physics.py", line 21, in <module>
from entities.post import Post
ImportError: cannot import name Post
,你可以看到,我用同樣的import語句進一步上漲和它的作品?有沒有關於循環導入的不成文規定?我如何在調用堆棧下面繼續使用同一個類?
另請參見:[「Python 2和Python 3中的循環導入:它們何時致命?它們何時工作?」](https://gist.github.com/datagrok/40bf84d5870c41a77dc6)。 –