Python循环依赖问题

时间:2018-11-24 00:34:42

标签: python python-2.7 import python-import

protected void ListofEmployees_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        foreach (DataPagerFieldItem dpfItem in dtpPaging.Controls)
            {
                foreach (Control cPagerControls in dpfItem.Controls)
                    {
                        // I want to write to write a code here if any pagination button is clicked
                             booleanValue = true;
                    }
            {
    }

 Dir->   test
           |_foo
             |__init__.py
              __a.py
              __b.py

**init.py**

 import os
 from test.foo.a import begin

 class Behaviour("some inherited class"):
   def good():
       print "good"
   def bad():
      begin()
 foo = Behaviour()

当__init__.py被调用时,我看到错误:

a.py

from . import foo

def end():
    print "running"
    foo.good()

def begin():
 print "begin"

好像我在这里遇到循环依赖问题。有人可以帮我解决这个问题吗?

0 个答案:

没有答案