<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國際加速解決方案。 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](iter.xhtml "迭代器協議") | - [上一頁](sequence.xhtml "Sequence Protocol") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python/C API 參考手冊](index.xhtml) ? - [抽象對象層](abstract.xhtml) ? - $('.inline-search').show(0); | # Mapping Protocol See also [`PyObject_GetItem()`](object.xhtml#c.PyObject_GetItem "PyObject_GetItem"), [`PyObject_SetItem()`](object.xhtml#c.PyObject_SetItem "PyObject_SetItem") and [`PyObject_DelItem()`](object.xhtml#c.PyObject_DelItem "PyObject_DelItem"). int `PyMapping_Check`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)Return `1` if the object provides mapping protocol or supports slicing, and `0` otherwise. Note that it returns `1` for Python classes with a [`__getitem__()`](../reference/datamodel.xhtml#object.__getitem__ "object.__getitem__") method since in general case it is impossible to determine what the type of keys it supports. This function always succeeds. Py\_ssize\_t `PyMapping_Size`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)Py\_ssize\_t `PyMapping_Length`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)Returns the number of keys in object *o* on success, and `-1` on failure. This is equivalent to the Python expression `len(o)`. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyMapping_GetItemString`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*, const char *\*key*)*Return value: New reference.*Return element of *o* corresponding to the string *key* or *NULL* on failure. This is the equivalent of the Python expression `o[key]`. See also [`PyObject_GetItem()`](object.xhtml#c.PyObject_GetItem "PyObject_GetItem"). int `PyMapping_SetItemString`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*, const char *\*key*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*v*)Map the string *key* to the value *v* in object *o*. Returns `-1` on failure. This is the equivalent of the Python statement `o[key] = v`. See also [`PyObject_SetItem()`](object.xhtml#c.PyObject_SetItem "PyObject_SetItem"). int `PyMapping_DelItem`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*key*)Remove the mapping for the object *key* from the object *o*. Return `-1`on failure. This is equivalent to the Python statement `del o[key]`. This is an alias of [`PyObject_DelItem()`](object.xhtml#c.PyObject_DelItem "PyObject_DelItem"). int `PyMapping_DelItemString`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*, const char *\*key*)Remove the mapping for the string *key* from the object *o*. Return `-1`on failure. This is equivalent to the Python statement `del o[key]`. int `PyMapping_HasKey`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*, [PyObject](structures.xhtml#c.PyObject "PyObject") *\*key*)Return `1` if the mapping object has the key *key* and `0` otherwise. This is equivalent to the Python expression `key in o`. This function always succeeds. Note that exceptions which occur while calling the [`__getitem__()`](../reference/datamodel.xhtml#object.__getitem__ "object.__getitem__")method will get suppressed. To get error reporting use [`PyObject_GetItem()`](object.xhtml#c.PyObject_GetItem "PyObject_GetItem") instead. int `PyMapping_HasKeyString`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*, const char *\*key*)Return `1` if the mapping object has the key *key* and `0` otherwise. This is equivalent to the Python expression `key in o`. This function always succeeds. Note that exceptions which occur while calling the [`__getitem__()`](../reference/datamodel.xhtml#object.__getitem__ "object.__getitem__")method and creating a temporary string object will get suppressed. To get error reporting use [`PyMapping_GetItemString()`](#c.PyMapping_GetItemString "PyMapping_GetItemString") instead. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyMapping_Keys`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*On success, return a list of the keys in object *o*. On failure, return *NULL*. 在 3.7 版更改: Previously, the function returned a list or a tuple. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyMapping_Values`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*On success, return a list of the values in object *o*. On failure, return *NULL*. 在 3.7 版更改: Previously, the function returned a list or a tuple. [PyObject](structures.xhtml#c.PyObject "PyObject")\* `PyMapping_Items`([PyObject](structures.xhtml#c.PyObject "PyObject") *\*o*)*Return value: New reference.*On success, return a list of the items in object *o*, where each item is a tuple containing a key-value pair. On failure, return *NULL*. 在 3.7 版更改: Previously, the function returned a list or a tuple. ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](iter.xhtml "迭代器協議") | - [上一頁](sequence.xhtml "Sequence Protocol") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python/C API 參考手冊](index.xhtml) ? - [抽象對象層](abstract.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>

                              哎呀哎呀视频在线观看