title: achieve Sington with cyclic imports in python
body: <p>I'm new in python.
  I have two py files like this:
  A.py</p>
  
  <pre><code>class LLL(object):
      pass
  
  ak=LLL()
  print(ak)
  
  def f1():
      from B import tt
  
      print("hello")
  
  if __name__=="__main__":
      f1()
  </code></pre>
  
  <p>and B.py</p>
  
  <pre><code>from A import ak
  def tt():
      print("sss")
  
  print(tt)
  </code></pre>
  
  <p>when i run A.py,i get the console below:</p>
  
  <pre><code>&lt;__main__.LLL object at 0x0000000000B69BE0&gt;
  &lt;A.LLL object at 0x0000000001461668&gt;
  &lt;function tt at 0x000000000124AD90&gt;
  hello
  </code></pre>
  
  <p>My question is why ak create twice?In B.py,i want to get the ak created in A.py,not create a new ak,it looks like import B will run all A's code,how can i fix it?</p>