title: How to override a module function which is used as a sub-function in another function imported by another .py file
body: <p>I have a module file called A.py and there is function containing a sub-function</p>
  <pre class="lang-py prettyprint-override"><code>#A.py
  def fun_A():
      sub_function()
  
  def sub_function():
      xxxx
  </code></pre>
  <p>and in B.py, I import A.py and use fun_A, but want to override the sub_function(), what should i do?</p>
  <pre class="lang-py prettyprint-override"><code># B.py
  import A
  def sub_function():
      xxxx
      xxxx
  
  fun_A()
  </code></pre>
  <p>could sub_funciton() in fun_A be overrided?</p>