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/set.rst

    r2 r391  
    1717This section details the public API for :class:`set` and :class:`frozenset`
    1818objects.  Any functionality not listed below is best accessed using the either
    19 the abstract object protocol (including :cfunc:`PyObject_CallMethod`,
    20 :cfunc:`PyObject_RichCompareBool`, :cfunc:`PyObject_Hash`,
    21 :cfunc:`PyObject_Repr`, :cfunc:`PyObject_IsTrue`, :cfunc:`PyObject_Print`, and
    22 :cfunc:`PyObject_GetIter`) or the abstract number protocol (including
    23 :cfunc:`PyNumber_And`, :cfunc:`PyNumber_Subtract`, :cfunc:`PyNumber_Or`,
    24 :cfunc:`PyNumber_Xor`, :cfunc:`PyNumber_InPlaceAnd`,
    25 :cfunc:`PyNumber_InPlaceSubtract`, :cfunc:`PyNumber_InPlaceOr`, and
    26 :cfunc:`PyNumber_InPlaceXor`).
     19the abstract object protocol (including :c:func:`PyObject_CallMethod`,
     20:c:func:`PyObject_RichCompareBool`, :c:func:`PyObject_Hash`,
     21:c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:`PyObject_Print`, and
     22:c:func:`PyObject_GetIter`) or the abstract number protocol (including
     23:c:func:`PyNumber_And`, :c:func:`PyNumber_Subtract`, :c:func:`PyNumber_Or`,
     24:c:func:`PyNumber_Xor`, :c:func:`PyNumber_InPlaceAnd`,
     25:c:func:`PyNumber_InPlaceSubtract`, :c:func:`PyNumber_InPlaceOr`, and
     26:c:func:`PyNumber_InPlaceXor`).
    2727
    2828
    29 .. ctype:: PySetObject
     29.. c:type:: PySetObject
    3030
    31    This subtype of :ctype:`PyObject` is used to hold the internal data for both
    32    :class:`set` and :class:`frozenset` objects.  It is like a :ctype:`PyDictObject`
     31   This subtype of :c:type:`PyObject` is used to hold the internal data for both
     32   :class:`set` and :class:`frozenset` objects.  It is like a :c:type:`PyDictObject`
    3333   in that it is a fixed size for small sets (much like tuple storage) and will
    3434   point to a separate, variable sized block of memory for medium and large sized
     
    3838
    3939
    40 .. cvar:: PyTypeObject PySet_Type
     40.. c:var:: PyTypeObject PySet_Type
    4141
    42    This is an instance of :ctype:`PyTypeObject` representing the Python
     42   This is an instance of :c:type:`PyTypeObject` representing the Python
    4343   :class:`set` type.
    4444
    4545
    46 .. cvar:: PyTypeObject PyFrozenSet_Type
     46.. c:var:: PyTypeObject PyFrozenSet_Type
    4747
    48    This is an instance of :ctype:`PyTypeObject` representing the Python
     48   This is an instance of :c:type:`PyTypeObject` representing the Python
    4949   :class:`frozenset` type.
    5050
     
    5353
    5454
    55 .. cfunction:: int PySet_Check(PyObject *p)
     55.. c:function:: int PySet_Check(PyObject *p)
    5656
    5757   Return true if *p* is a :class:`set` object or an instance of a subtype.
     
    5959   .. versionadded:: 2.6
    6060
    61 .. cfunction:: int PyFrozenSet_Check(PyObject *p)
     61.. c:function:: int PyFrozenSet_Check(PyObject *p)
    6262
    6363   Return true if *p* is a :class:`frozenset` object or an instance of a
     
    6666   .. versionadded:: 2.6
    6767
    68 .. cfunction:: int PyAnySet_Check(PyObject *p)
     68.. c:function:: int PyAnySet_Check(PyObject *p)
    6969
    7070   Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or an
     
    7272
    7373
    74 .. cfunction:: int PyAnySet_CheckExact(PyObject *p)
     74.. c:function:: int PyAnySet_CheckExact(PyObject *p)
    7575
    7676   Return true if *p* is a :class:`set` object or a :class:`frozenset` object but
     
    7878
    7979
    80 .. cfunction:: int PyFrozenSet_CheckExact(PyObject *p)
     80.. c:function:: int PyFrozenSet_CheckExact(PyObject *p)
    8181
    8282   Return true if *p* is a :class:`frozenset` object but not an instance of a
     
    8484
    8585
    86 .. cfunction:: PyObject* PySet_New(PyObject *iterable)
     86.. c:function:: PyObject* PySet_New(PyObject *iterable)
    8787
    8888   Return a new :class:`set` containing objects returned by the *iterable*.  The
     
    9393
    9494
    95 .. cfunction:: PyObject* PyFrozenSet_New(PyObject *iterable)
     95.. c:function:: PyObject* PyFrozenSet_New(PyObject *iterable)
    9696
    9797   Return a new :class:`frozenset` containing objects returned by the *iterable*.
     
    109109
    110110
    111 .. cfunction:: Py_ssize_t PySet_Size(PyObject *anyset)
     111.. c:function:: Py_ssize_t PySet_Size(PyObject *anyset)
    112112
    113113   .. index:: builtin: len
     
    118118
    119119   .. versionchanged:: 2.5
    120       This function returned an :ctype:`int`. This might require changes in
     120      This function returned an :c:type:`int`. This might require changes in
    121121      your code for properly supporting 64-bit systems.
    122122
    123123
    124 .. cfunction:: Py_ssize_t PySet_GET_SIZE(PyObject *anyset)
     124.. c:function:: Py_ssize_t PySet_GET_SIZE(PyObject *anyset)
    125125
    126    Macro form of :cfunc:`PySet_Size` without error checking.
     126   Macro form of :c:func:`PySet_Size` without error checking.
    127127
    128128
    129 .. cfunction:: int PySet_Contains(PyObject *anyset, PyObject *key)
     129.. c:function:: int PySet_Contains(PyObject *anyset, PyObject *key)
    130130
    131131   Return 1 if found, 0 if not found, and -1 if an error is encountered.  Unlike
     
    136136
    137137
    138 .. cfunction:: int PySet_Add(PyObject *set, PyObject *key)
     138.. c:function:: int PySet_Add(PyObject *set, PyObject *key)
    139139
    140140   Add *key* to a :class:`set` instance.  Does not apply to :class:`frozenset`
     
    146146   .. versionchanged:: 2.6
    147147      Now works with instances of :class:`frozenset` or its subtypes.
    148       Like :cfunc:`PyTuple_SetItem` in that it can be used to fill-in the
     148      Like :c:func:`PyTuple_SetItem` in that it can be used to fill-in the
    149149      values of brand new frozensets before they are exposed to other code.
    150150
     
    153153
    154154
    155 .. cfunction:: int PySet_Discard(PyObject *set, PyObject *key)
     155.. c:function:: int PySet_Discard(PyObject *set, PyObject *key)
    156156
    157157   Return 1 if found and removed, 0 if not found (no action taken), and -1 if an
    158158   error is encountered.  Does not raise :exc:`KeyError` for missing keys.  Raise a
    159    :exc:`TypeError` if the *key* is unhashable.  Unlike the Python :meth:`discard`
     159   :exc:`TypeError` if the *key* is unhashable.  Unlike the Python :meth:`~set.discard`
    160160   method, this function does not automatically convert unhashable sets into
    161161   temporary frozensets. Raise :exc:`PyExc_SystemError` if *set* is an not an
     
    163163
    164164
    165 .. cfunction:: PyObject* PySet_Pop(PyObject *set)
     165.. c:function:: PyObject* PySet_Pop(PyObject *set)
    166166
    167167   Return a new reference to an arbitrary object in the *set*, and removes the
     
    171171
    172172
    173 .. cfunction:: int PySet_Clear(PyObject *set)
     173.. c:function:: int PySet_Clear(PyObject *set)
    174174
    175175   Empty an existing set of all elements.
Note: See TracChangeset for help on using the changeset viewer.