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

    r2 r391  
    77
    88
    9 .. cfunction:: int PyNumber_Check(PyObject *o)
     9.. c:function:: int PyNumber_Check(PyObject *o)
    1010
    1111   Returns ``1`` if the object *o* provides numeric protocols, and false otherwise.
     
    1313
    1414
    15 .. cfunction:: PyObject* PyNumber_Add(PyObject *o1, PyObject *o2)
     15.. c:function:: PyObject* PyNumber_Add(PyObject *o1, PyObject *o2)
    1616
    1717   Returns the result of adding *o1* and *o2*, or *NULL* on failure.  This is the
     
    1919
    2020
    21 .. cfunction:: PyObject* PyNumber_Subtract(PyObject *o1, PyObject *o2)
     21.. c:function:: PyObject* PyNumber_Subtract(PyObject *o1, PyObject *o2)
    2222
    2323   Returns the result of subtracting *o2* from *o1*, or *NULL* on failure.  This is
     
    2525
    2626
    27 .. cfunction:: PyObject* PyNumber_Multiply(PyObject *o1, PyObject *o2)
     27.. c:function:: PyObject* PyNumber_Multiply(PyObject *o1, PyObject *o2)
    2828
    2929   Returns the result of multiplying *o1* and *o2*, or *NULL* on failure.  This is
     
    3131
    3232
    33 .. cfunction:: PyObject* PyNumber_Divide(PyObject *o1, PyObject *o2)
     33.. c:function:: PyObject* PyNumber_Divide(PyObject *o1, PyObject *o2)
    3434
    3535   Returns the result of dividing *o1* by *o2*, or *NULL* on failure.  This is the
     
    3737
    3838
    39 .. cfunction:: PyObject* PyNumber_FloorDivide(PyObject *o1, PyObject *o2)
     39.. c:function:: PyObject* PyNumber_FloorDivide(PyObject *o1, PyObject *o2)
    4040
    4141   Return the floor of *o1* divided by *o2*, or *NULL* on failure.  This is
     
    4545
    4646
    47 .. cfunction:: PyObject* PyNumber_TrueDivide(PyObject *o1, PyObject *o2)
     47.. c:function:: PyObject* PyNumber_TrueDivide(PyObject *o1, PyObject *o2)
    4848
    4949   Return a reasonable approximation for the mathematical value of *o1* divided by
     
    5656
    5757
    58 .. cfunction:: PyObject* PyNumber_Remainder(PyObject *o1, PyObject *o2)
     58.. c:function:: PyObject* PyNumber_Remainder(PyObject *o1, PyObject *o2)
    5959
    6060   Returns the remainder of dividing *o1* by *o2*, or *NULL* on failure.  This is
     
    6262
    6363
    64 .. cfunction:: PyObject* PyNumber_Divmod(PyObject *o1, PyObject *o2)
     64.. c:function:: PyObject* PyNumber_Divmod(PyObject *o1, PyObject *o2)
    6565
    6666   .. index:: builtin: divmod
     
    7070
    7171
    72 .. cfunction:: PyObject* PyNumber_Power(PyObject *o1, PyObject *o2, PyObject *o3)
     72.. c:function:: PyObject* PyNumber_Power(PyObject *o1, PyObject *o2, PyObject *o3)
    7373
    7474   .. index:: builtin: pow
     
    7676   See the built-in function :func:`pow`. Returns *NULL* on failure.  This is the
    7777   equivalent of the Python expression ``pow(o1, o2, o3)``, where *o3* is optional.
    78    If *o3* is to be ignored, pass :cdata:`Py_None` in its place (passing *NULL* for
     78   If *o3* is to be ignored, pass :c:data:`Py_None` in its place (passing *NULL* for
    7979   *o3* would cause an illegal memory access).
    8080
    8181
    82 .. cfunction:: PyObject* PyNumber_Negative(PyObject *o)
     82.. c:function:: PyObject* PyNumber_Negative(PyObject *o)
    8383
    8484   Returns the negation of *o* on success, or *NULL* on failure. This is the
     
    8686
    8787
    88 .. cfunction:: PyObject* PyNumber_Positive(PyObject *o)
     88.. c:function:: PyObject* PyNumber_Positive(PyObject *o)
    8989
    9090   Returns *o* on success, or *NULL* on failure.  This is the equivalent of the
     
    9292
    9393
    94 .. cfunction:: PyObject* PyNumber_Absolute(PyObject *o)
     94.. c:function:: PyObject* PyNumber_Absolute(PyObject *o)
    9595
    9696   .. index:: builtin: abs
     
    100100
    101101
    102 .. cfunction:: PyObject* PyNumber_Invert(PyObject *o)
     102.. c:function:: PyObject* PyNumber_Invert(PyObject *o)
    103103
    104104   Returns the bitwise negation of *o* on success, or *NULL* on failure.  This is
     
    106106
    107107
    108 .. cfunction:: PyObject* PyNumber_Lshift(PyObject *o1, PyObject *o2)
     108.. c:function:: PyObject* PyNumber_Lshift(PyObject *o1, PyObject *o2)
    109109
    110110   Returns the result of left shifting *o1* by *o2* on success, or *NULL* on
     
    112112
    113113
    114 .. cfunction:: PyObject* PyNumber_Rshift(PyObject *o1, PyObject *o2)
     114.. c:function:: PyObject* PyNumber_Rshift(PyObject *o1, PyObject *o2)
    115115
    116116   Returns the result of right shifting *o1* by *o2* on success, or *NULL* on
     
    118118
    119119
    120 .. cfunction:: PyObject* PyNumber_And(PyObject *o1, PyObject *o2)
     120.. c:function:: PyObject* PyNumber_And(PyObject *o1, PyObject *o2)
    121121
    122122   Returns the "bitwise and" of *o1* and *o2* on success and *NULL* on failure.
     
    124124
    125125
    126 .. cfunction:: PyObject* PyNumber_Xor(PyObject *o1, PyObject *o2)
     126.. c:function:: PyObject* PyNumber_Xor(PyObject *o1, PyObject *o2)
    127127
    128128   Returns the "bitwise exclusive or" of *o1* by *o2* on success, or *NULL* on
     
    130130
    131131
    132 .. cfunction:: PyObject* PyNumber_Or(PyObject *o1, PyObject *o2)
     132.. c:function:: PyObject* PyNumber_Or(PyObject *o1, PyObject *o2)
    133133
    134134   Returns the "bitwise or" of *o1* and *o2* on success, or *NULL* on failure.
     
    136136
    137137
    138 .. cfunction:: PyObject* PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2)
     138.. c:function:: PyObject* PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2)
    139139
    140140   Returns the result of adding *o1* and *o2*, or *NULL* on failure.  The operation
     
    143143
    144144
    145 .. cfunction:: PyObject* PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2)
     145.. c:function:: PyObject* PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2)
    146146
    147147   Returns the result of subtracting *o2* from *o1*, or *NULL* on failure.  The
     
    150150
    151151
    152 .. cfunction:: PyObject* PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2)
     152.. c:function:: PyObject* PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2)
    153153
    154154   Returns the result of multiplying *o1* and *o2*, or *NULL* on failure.  The
     
    157157
    158158
    159 .. cfunction:: PyObject* PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2)
     159.. c:function:: PyObject* PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2)
    160160
    161161   Returns the result of dividing *o1* by *o2*, or *NULL* on failure.  The
     
    164164
    165165
    166 .. cfunction:: PyObject* PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2)
     166.. c:function:: PyObject* PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2)
    167167
    168168   Returns the mathematical floor of dividing *o1* by *o2*, or *NULL* on failure.
     
    173173
    174174
    175 .. cfunction:: PyObject* PyNumber_InPlaceTrueDivide(PyObject *o1, PyObject *o2)
     175.. c:function:: PyObject* PyNumber_InPlaceTrueDivide(PyObject *o1, PyObject *o2)
    176176
    177177   Return a reasonable approximation for the mathematical value of *o1* divided by
     
    184184
    185185
    186 .. cfunction:: PyObject* PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2)
     186.. c:function:: PyObject* PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2)
    187187
    188188   Returns the remainder of dividing *o1* by *o2*, or *NULL* on failure.  The
     
    191191
    192192
    193 .. cfunction:: PyObject* PyNumber_InPlacePower(PyObject *o1, PyObject *o2, PyObject *o3)
     193.. c:function:: PyObject* PyNumber_InPlacePower(PyObject *o1, PyObject *o2, PyObject *o3)
    194194
    195195   .. index:: builtin: pow
     
    197197   See the built-in function :func:`pow`. Returns *NULL* on failure.  The operation
    198198   is done *in-place* when *o1* supports it.  This is the equivalent of the Python
    199    statement ``o1 **= o2`` when o3 is :cdata:`Py_None`, or an in-place variant of
    200    ``pow(o1, o2, o3)`` otherwise. If *o3* is to be ignored, pass :cdata:`Py_None`
     199   statement ``o1 **= o2`` when o3 is :c:data:`Py_None`, or an in-place variant of
     200   ``pow(o1, o2, o3)`` otherwise. If *o3* is to be ignored, pass :c:data:`Py_None`
    201201   in its place (passing *NULL* for *o3* would cause an illegal memory access).
    202202
    203203
    204 .. cfunction:: PyObject* PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2)
     204.. c:function:: PyObject* PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2)
    205205
    206206   Returns the result of left shifting *o1* by *o2* on success, or *NULL* on
     
    209209
    210210
    211 .. cfunction:: PyObject* PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2)
     211.. c:function:: PyObject* PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2)
    212212
    213213   Returns the result of right shifting *o1* by *o2* on success, or *NULL* on
     
    216216
    217217
    218 .. cfunction:: PyObject* PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2)
     218.. c:function:: PyObject* PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2)
    219219
    220220   Returns the "bitwise and" of *o1* and *o2* on success and *NULL* on failure. The
     
    223223
    224224
    225 .. cfunction:: PyObject* PyNumber_InPlaceXor(PyObject *o1, PyObject *o2)
     225.. c:function:: PyObject* PyNumber_InPlaceXor(PyObject *o1, PyObject *o2)
    226226
    227227   Returns the "bitwise exclusive or" of *o1* by *o2* on success, or *NULL* on
     
    230230
    231231
    232 .. cfunction:: PyObject* PyNumber_InPlaceOr(PyObject *o1, PyObject *o2)
     232.. c:function:: PyObject* PyNumber_InPlaceOr(PyObject *o1, PyObject *o2)
    233233
    234234   Returns the "bitwise or" of *o1* and *o2* on success, or *NULL* on failure.  The
     
    237237
    238238
    239 .. cfunction:: int PyNumber_Coerce(PyObject **p1, PyObject **p2)
     239.. c:function:: int PyNumber_Coerce(PyObject **p1, PyObject **p2)
    240240
    241241   .. index:: builtin: coerce
    242242
    243    This function takes the addresses of two variables of type :ctype:`PyObject\*`.
     243   This function takes the addresses of two variables of type :c:type:`PyObject\*`.
    244244   If the objects pointed to by ``*p1`` and ``*p2`` have the same type, increment
    245245   their reference count and return ``0`` (success). If the objects can be
     
    251251
    252252
    253 .. cfunction:: int PyNumber_CoerceEx(PyObject **p1, PyObject **p2)
    254 
    255    This function is similar to :cfunc:`PyNumber_Coerce`, except that it returns
     253.. c:function:: int PyNumber_CoerceEx(PyObject **p1, PyObject **p2)
     254
     255   This function is similar to :c:func:`PyNumber_Coerce`, except that it returns
    256256   ``1`` when the conversion is not possible and when no error is raised.
    257257   Reference counts are still not increased in this case.
    258258
    259259
    260 .. cfunction:: PyObject* PyNumber_Int(PyObject *o)
     260.. c:function:: PyObject* PyNumber_Int(PyObject *o)
    261261
    262262   .. index:: builtin: int
     
    267267
    268268
    269 .. cfunction:: PyObject* PyNumber_Long(PyObject *o)
     269.. c:function:: PyObject* PyNumber_Long(PyObject *o)
    270270
    271271   .. index:: builtin: long
     
    275275
    276276
    277 .. cfunction:: PyObject* PyNumber_Float(PyObject *o)
     277.. c:function:: PyObject* PyNumber_Float(PyObject *o)
    278278
    279279   .. index:: builtin: float
     
    283283
    284284
    285 .. cfunction:: PyObject* PyNumber_Index(PyObject *o)
     285.. c:function:: PyObject* PyNumber_Index(PyObject *o)
    286286
    287287   Returns the *o* converted to a Python int or long on success or *NULL* with a
     
    291291
    292292
    293 .. cfunction:: PyObject* PyNumber_ToBase(PyObject *n, int base)
     293.. c:function:: PyObject* PyNumber_ToBase(PyObject *n, int base)
    294294
    295295   Returns the integer *n* converted to *base* as a string with a base
     
    297297   *base* is not 2, 8, 10, or 16, the format is ``'x#num'`` where x is the
    298298   base. If *n* is not an int object, it is converted with
    299    :cfunc:`PyNumber_Index` first.
     299   :c:func:`PyNumber_Index` first.
    300300
    301301   .. versionadded:: 2.6
    302302
    303303
    304 .. cfunction:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
     304.. c:function:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
    305305
    306306   Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an
     
    315315
    316316
    317 .. cfunction:: int PyIndex_Check(PyObject *o)
     317.. c:function:: int PyIndex_Check(PyObject *o)
    318318
    319319   Returns True if *o* is an index integer (has the nb_index slot of  the
Note: See TracChangeset for help on using the changeset viewer.