<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # pxd 文件 > 原文: [http://docs.cython.org/en/latest/src/tutorial/pxd_files.html](http://docs.cython.org/en/latest/src/tutorial/pxd_files.html) 除了`.pyx`源文件之外,Cython 還使用`.pxd`文件,它們的工作方式類似于 C 頭文件 - 它們包含 Cython 聲明(有時是代碼部分),僅供 Cython 模塊使用。使用`cimport`關鍵字將`pxd`文件導入`pyx`模塊。 `pxd`文件有很多用例: > 1. 它們可用于共享外部 C 聲明。 > > > 2. 它們可以包含非常適合 C 編譯器內聯的函數。這些功能應標記為`inline`,例如: > > > > ```py > cdef inline int int_min(int a, int b): > return b if b &lt; a else a > > ``` > > > 3. 當附帶同名的`pyx`文件時,它們為 Cython 模塊提供了一個 Cython 接口,以便其他 Cython 模塊可以使用比 Python 更高效的協議與之通信。 在我們的集成示例中,我們可能會將其分解為`pxd`文件,如下所示: > 1. 添加`cmath.pxd`功能,定義 C `math.h`頭文件中可用的 C 功能,如`sin`。然后人們只需在`integrate.pyx`中做`from cmath cimport sin`。 > > > 2. 添加`integrate.pxd`,以便用 Cython 編寫的其他模塊可以定義要集成的快速自定義函數。 > > > > ```py > cdef class Function: > cpdef evaluate(self, double x) > cpdef integrate(Function f, double a, > double b, int N) > > ``` > > > > 請注意,如果您的 cdef 類具有屬性,則必須在類聲明`pxd`文件(如果使用)中聲明屬性,而不是`pyx`文件。編譯器會告訴你這個。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看