Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/c-api/dict.rst

    r2 r391  
    99
    1010
    11 .. ctype:: PyDictObject
    12 
    13    This subtype of :ctype:`PyObject` represents a Python dictionary object.
    14 
    15 
    16 .. cvar:: PyTypeObject PyDict_Type
     11.. c:type:: PyDictObject
     12
     13   This subtype of :c:type:`PyObject` represents a Python dictionary object.
     14
     15
     16.. c:var:: PyTypeObject PyDict_Type
    1717
    1818   .. index::
     
    2020      single: DictionaryType (in module types)
    2121
    22    This instance of :ctype:`PyTypeObject` represents the Python dictionary
     22   This instance of :c:type:`PyTypeObject` represents the Python dictionary
    2323   type.  This is exposed to Python programs as ``dict`` and
    2424   ``types.DictType``.
    2525
    2626
    27 .. cfunction:: int PyDict_Check(PyObject *p)
     27.. c:function:: int PyDict_Check(PyObject *p)
    2828
    2929   Return true if *p* is a dict object or an instance of a subtype of the dict
     
    3434
    3535
    36 .. cfunction:: int PyDict_CheckExact(PyObject *p)
     36.. c:function:: int PyDict_CheckExact(PyObject *p)
    3737
    3838   Return true if *p* is a dict object, but not an instance of a subtype of
     
    4242
    4343
    44 .. cfunction:: PyObject* PyDict_New()
     44.. c:function:: PyObject* PyDict_New()
    4545
    4646   Return a new empty dictionary, or *NULL* on failure.
    4747
    4848
    49 .. cfunction:: PyObject* PyDictProxy_New(PyObject *dict)
     49.. c:function:: PyObject* PyDictProxy_New(PyObject *dict)
    5050
    5151   Return a proxy object for a mapping which enforces read-only behavior.
     
    5656
    5757
    58 .. cfunction:: void PyDict_Clear(PyObject *p)
     58.. c:function:: void PyDict_Clear(PyObject *p)
    5959
    6060   Empty an existing dictionary of all key-value pairs.
    6161
    6262
    63 .. cfunction:: int PyDict_Contains(PyObject *p, PyObject *key)
     63.. c:function:: int PyDict_Contains(PyObject *p, PyObject *key)
    6464
    6565   Determine if dictionary *p* contains *key*.  If an item in *p* is matches
     
    7070
    7171
    72 .. cfunction:: PyObject* PyDict_Copy(PyObject *p)
     72.. c:function:: PyObject* PyDict_Copy(PyObject *p)
    7373
    7474   Return a new dictionary that contains the same key-value pairs as *p*.
     
    7777
    7878
    79 .. cfunction:: int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)
     79.. c:function:: int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)
    8080
    8181   Insert *value* into the dictionary *p* with a key of *key*.  *key* must be
     
    8484
    8585
    86 .. cfunction:: int PyDict_SetItemString(PyObject *p, const char *key, PyObject *val)
     86.. c:function:: int PyDict_SetItemString(PyObject *p, const char *key, PyObject *val)
    8787
    8888   .. index:: single: PyString_FromString()
    8989
    9090   Insert *value* into the dictionary *p* using *key* as a key. *key* should
    91    be a :ctype:`char\*`.  The key object is created using
     91   be a :c:type:`char\*`.  The key object is created using
    9292   ``PyString_FromString(key)``.  Return ``0`` on success or ``-1`` on
    9393   failure.
    9494
    9595
    96 .. cfunction:: int PyDict_DelItem(PyObject *p, PyObject *key)
     96.. c:function:: int PyDict_DelItem(PyObject *p, PyObject *key)
    9797
    9898   Remove the entry in dictionary *p* with key *key*. *key* must be hashable;
     
    101101
    102102
    103 .. cfunction:: int PyDict_DelItemString(PyObject *p, char *key)
     103.. c:function:: int PyDict_DelItemString(PyObject *p, char *key)
    104104
    105105   Remove the entry in dictionary *p* which has a key specified by the string
     
    107107
    108108
    109 .. cfunction:: PyObject* PyDict_GetItem(PyObject *p, PyObject *key)
     109.. c:function:: PyObject* PyDict_GetItem(PyObject *p, PyObject *key)
    110110
    111111   Return the object from dictionary *p* which has a key *key*.  Return *NULL*
     
    113113
    114114
    115 .. cfunction:: PyObject* PyDict_GetItemString(PyObject *p, const char *key)
    116 
    117    This is the same as :cfunc:`PyDict_GetItem`, but *key* is specified as a
    118    :ctype:`char\*`, rather than a :ctype:`PyObject\*`.
    119 
    120 
    121 .. cfunction:: PyObject* PyDict_Items(PyObject *p)
    122 
    123    Return a :ctype:`PyListObject` containing all the items from the
     115.. c:function:: PyObject* PyDict_GetItemString(PyObject *p, const char *key)
     116
     117   This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a
     118   :c:type:`char\*`, rather than a :c:type:`PyObject\*`.
     119
     120
     121.. c:function:: PyObject* PyDict_Items(PyObject *p)
     122
     123   Return a :c:type:`PyListObject` containing all the items from the
    124124   dictionary, as in the dictionary method :meth:`dict.items`.
    125125
    126126
    127 .. cfunction:: PyObject* PyDict_Keys(PyObject *p)
    128 
    129    Return a :ctype:`PyListObject` containing all the keys from the dictionary,
     127.. c:function:: PyObject* PyDict_Keys(PyObject *p)
     128
     129   Return a :c:type:`PyListObject` containing all the keys from the dictionary,
    130130   as in the dictionary method :meth:`dict.keys`.
    131131
    132132
    133 .. cfunction:: PyObject* PyDict_Values(PyObject *p)
    134 
    135    Return a :ctype:`PyListObject` containing all the values from the
     133.. c:function:: PyObject* PyDict_Values(PyObject *p)
     134
     135   Return a :c:type:`PyListObject` containing all the values from the
    136136   dictionary *p*, as in the dictionary method :meth:`dict.values`.
    137137
    138138
    139 .. cfunction:: Py_ssize_t PyDict_Size(PyObject *p)
     139.. c:function:: Py_ssize_t PyDict_Size(PyObject *p)
    140140
    141141   .. index:: builtin: len
     
    145145
    146146   .. versionchanged:: 2.5
    147       This function returned an :ctype:`int` type.  This might require changes
     147      This function returned an :c:type:`int` type.  This might require changes
    148148      in your code for properly supporting 64-bit systems.
    149149
    150150
    151 .. cfunction:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
     151.. c:function:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
    152152
    153153   Iterate over all key-value pairs in the dictionary *p*.  The
    154    :ctype:`Py_ssize_t` referred to by *ppos* must be initialized to ``0``
     154   :c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0``
    155155   prior to the first call to this function to start the iteration; the
    156156   function returns true for each pair in the dictionary, and false once all
    157157   pairs have been reported.  The parameters *pkey* and *pvalue* should either
    158    point to :ctype:`PyObject\*` variables that will be filled in with each key
     158   point to :c:type:`PyObject\*` variables that will be filled in with each key
    159159   and value, respectively, or may be *NULL*.  Any references returned through
    160160   them are borrowed.  *ppos* should not be altered during iteration. Its
     
    193193
    194194   .. versionchanged:: 2.5
    195       This function used an :ctype:`int *` type for *ppos*. This might require
     195      This function used an :c:type:`int *` type for *ppos*. This might require
    196196      changes in your code for properly supporting 64-bit systems.
    197197
    198198
    199 .. cfunction:: int PyDict_Merge(PyObject *a, PyObject *b, int override)
     199.. c:function:: int PyDict_Merge(PyObject *a, PyObject *b, int override)
    200200
    201201   Iterate over mapping object *b* adding key-value pairs to dictionary *a*.
    202    *b* may be a dictionary, or any object supporting :func:`PyMapping_Keys`
    203    and :func:`PyObject_GetItem`. If *override* is true, existing pairs in *a*
     202   *b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys`
     203   and :c:func:`PyObject_GetItem`. If *override* is true, existing pairs in *a*
    204204   will be replaced if a matching key is found in *b*, otherwise pairs will
    205205   only be added if there is not a matching key in *a*. Return ``0`` on
     
    209209
    210210
    211 .. cfunction:: int PyDict_Update(PyObject *a, PyObject *b)
     211.. c:function:: int PyDict_Update(PyObject *a, PyObject *b)
    212212
    213213   This is the same as ``PyDict_Merge(a, b, 1)`` in C, or ``a.update(b)`` in
     
    217217
    218218
    219 .. cfunction:: int PyDict_MergeFromSeq2(PyObject *a, PyObject *seq2, int override)
     219.. c:function:: int PyDict_MergeFromSeq2(PyObject *a, PyObject *seq2, int override)
    220220
    221221   Update or merge into dictionary *a*, from the key-value pairs in *seq2*.
Note: See TracChangeset for help on using the changeset viewer.