提交 cd458dd5 authored 作者: James Bergstra's avatar James Bergstra

module tutorial reword

上级 b7a4f4cd
......@@ -244,13 +244,14 @@ Mechanism 2: InstanceType
If a number of instance methods are going to be defined, and especially if you
will want to inherit from the kind of class that gets instantiated by make,
you will want to consider using the InstanceType mechanism.
you might prefer to consider using the InstanceType mechanism.
.. code-block:: python
class AccumulatorInstance(ModuleInstance):
def print_state(self):
#self.component points to the Module from which this was compiled.
print '%s is: %s' % (self.component.state, self.state)
class Accumulator(Module):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论