擅长:python、mysql、java
<p>基本上,您在Python中提供的类链接回答了关于继承的部分中的所有问题。
在您的例子中,只需定义一个名为Model的类,然后定义两个子类:singleAgent和doubleAgent:</p>
<pre><code>class Model:
pass
class singleAgent(Model):
pass
</code></pre>
<p>如果您确实需要抽象类,请看一看“抽象基类”es:<a href="http://docs.python.org/library/abc.html" rel="nofollow">http://docs.python.org/library/abc.html</a></p>