擅长:python、mysql、java
<p>为了在cython中定义<code>boolean</code>对象,需要将它们定义为<code>bint</code>。根据<a href="https://github.com/cython/cython/wiki/DifferencesFromPyrex" rel="nofollow noreferrer">here</a>:“boolean int”对象的bint被编译为一个c int,但被强制作为booleans在Cython之间往返。</p>
<p>示例:</p>
<pre><code>cdef bint boolean_variable = True
</code></pre>
<p>来源:<a href="https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#types" rel="nofollow noreferrer">types bint</a></p>