擅长:python、mysql、java
<p>Decorator语法只是将函数应用于类的快捷方式。
一旦知道<code>max_count</code>的值,就可以自己调用该函数。你知道吗</p>
<pre><code>class Calculation(ActorTypeDispatcher):
...
# Time passes
c = input("Max count: ")
Calculation = troupe(max_count=int(c), idle_count=2)(Calculation)
</code></pre>
<p>(或者,在定义<code>Calculation</code>(如<a href="https://stackoverflow.com/a/55691015/1126841">shown by @brunns</a>)之前,只需等待您拥有<code>c</code>)</p>