<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](structures.xhtml "Common Object Structures") | - [上一頁](objimpl.xhtml "對象實現支持") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python/C API 參考手冊](index.xhtml) ? - [對象實現支持](objimpl.xhtml) ? - $('.inline-search').show(0); | # 在堆中分配對象 [PyObject](structures.xhtml#c.PyObject "PyObject")\* `_PyObject_New`([PyTypeObject](type.xhtml#c.PyTypeObject "PyTypeObject") *\*type*)*Return value: New reference.*[PyVarObject](structures.xhtml#c.PyVarObject "PyVarObject")\* `_PyObject_NewVar`([PyTypeObject](type.xhtml#c.PyTypeObject "PyTypeObject") *\*type*, Py\_ssize\_t *size*)*Return value: New reference.*[PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyObject_Init`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*op*, [PyTypeObject](type.xhtml#c.PyTypeObject "PyTypeObject") *\*type*)*Return value: Borrowed reference.*為新分配的對象 *op* 初始化它的類型和引用。返回初始化后的對象。如果 *type* 聲明這個對象參與循環垃圾檢測,那么這個對象會被添加進垃圾檢測的對象集中。這個對象的其他字段不會被影響。 [PyVarObject](structures.xhtml#c.PyVarObject "PyVarObject")\* `PyObject_InitVar`([PyVarObject](structures.xhtml#c.PyVarObject "PyVarObject") *\*op*, [PyTypeObject](type.xhtml#c.PyTypeObject "PyTypeObject") *\*type*, Py\_ssize\_t *size*)*Return value: Borrowed reference.*它的功能和 [`PyObject_Init()`](#c.PyObject_Init "PyObject_Init") 一樣,并且初始化變量大小的對象的長度。 TYPE\* `PyObject_New`(TYPE, [PyTypeObject](type.xhtml#c.PyTypeObject "PyTypeObject") *\*type*)*Return value: New reference.*使用C的數據結構類型 *TYPE* 和Python的類型對象 *type* 分配一個新的Python對象。Python對象頭文件中沒有定義的字段不會被初始化;對象的引用計數為1。內存分配大小由type對象中的 [`tp_basicsize`](typeobj.xhtml#c.PyTypeObject.tp_basicsize "PyTypeObject.tp_basicsize") 字段決定。 TYPE\* `PyObject_NewVar`(TYPE, [PyTypeObject](type.xhtml#c.PyTypeObject "PyTypeObject") *\*type*, Py\_ssize\_t *size*)*Return value: New reference.*使用C的數據結構類型 *TYPE* 和Python的類型對象 *type* 分配一個新的Python對象。Python對象頭文件中沒有定義的字段不會被初始化。被分配的內存空間預留了 *TYPE* 結構加 *type* 對象中 [`tp_itemsize`](typeobj.xhtml#c.PyTypeObject.tp_itemsize "PyTypeObject.tp_itemsize") 字段提供的 *size* 字段的值。這對于實現類似元組這種能夠在構造期決定自己大小的對象是很實用的。將字段的數組嵌入到相同的內存分配中可以減少內存分配的次數,這提高了內存分配的效率。 void `PyObject_Del`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*op*)釋放由 [`PyObject_New()`](#c.PyObject_New "PyObject_New") 或者 [`PyObject_NewVar()`](#c.PyObject_NewVar "PyObject_NewVar") 分配內存的對象。這通常由對象的type字段定義的 [`tp_dealloc`](typeobj.xhtml#c.PyTypeObject.tp_dealloc "PyTypeObject.tp_dealloc") 處理函數來調用。調用這個函數以后op對象中的字段都不可以被訪問,因為原分配的內存空間已不再是一個有效的Python對象。 [PyObject](structures.xhtml#c.PyObject "PyObject")`_Py_NoneStruct`像 `None` 一樣的Python對象。這個對象僅可以使用 [`Py_None`](none.xhtml#c.Py_None "Py_None") 宏訪問,這個宏取得指向這個對象的指針。 參見 [`PyModule_Create()`](module.xhtml#c.PyModule_Create "PyModule_Create")分配內存和創建擴展模塊。 ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](structures.xhtml "Common Object Structures") | - [上一頁](objimpl.xhtml "對象實現支持") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python/C API 參考手冊](index.xhtml) ? - [對象實現支持](objimpl.xhtml) ? - $('.inline-search').show(0); | ? [版權所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 軟件基金會是一個非盈利組織。 [請捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [發現了問題](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 創建。
                  <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>

                              哎呀哎呀视频在线观看