title: How to override a method used by a 3rd party library
body: <p>This would be the layout</p>
  
  <p>some_function.py</p>
  
  <pre><code>def some_function():
      print("some_function")
  </code></pre>
  
  <p>some_library.py</p>
  
  <pre><code>from some_function import some_function
  
  class A:
      def xxx(self):
          some_function()
  </code></pre>
  
  <p>main.py</p>
  
  <pre><code>from some_library import A
  from some_function import some_function
  
  def new_some_function():
      print("new_some_function")
  
  if __name__ == '__main__':
      some_function = new_some_function
      a = A()
      a.xxx()
  </code></pre>
  
  <p>In the class <code>A</code>, the method <code>xxx</code>, calls <code>some_function</code>, so is it possible to override it with something else, without re-implementing the entire class?</p>