擅长:python、mysql、java
<p>比你想象的要容易:</p>
<pre><code>class Instrument(Object):
def __init__(self):
self.flag = True
def direct_method(self,arg1):
self.external_method(arg1, arg2)
import to_import_from
Instrument.external_method = to_import_from.external_method
</code></pre>
<p>完成!</p>
<p>尽管让机器生成的代码生成一个类定义并从中进行子类化是一个更简洁的解决方案。</p>