擅长:python、mysql、java
<p>使用函数和循环:</p>
<pre><code>def checknone(**things_with_names):
for name, thing in things_with_names.items():
if thing is None:
return ErrorCode.CORRUPTED_DATABASE, name + " IS MISSING"
return True
</code></pre>
<p>并以此方式使用:</p>
^{pr2}$
<p>为了获得最大的收益,将它作为一个类的方法,您将把它混合到所有使用它的类中。这样它也可以设置<code>isValid</code>。在</p>