Changeset 391 for python/trunk/Doc/c-api/int.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/c-api/int.rst
r2 r391 9 9 10 10 11 .. c type:: PyIntObject11 .. c:type:: PyIntObject 12 12 13 This subtype of :c type:`PyObject` represents a Python integer object.13 This subtype of :c:type:`PyObject` represents a Python integer object. 14 14 15 15 16 .. c var:: PyTypeObject PyInt_Type16 .. c:var:: PyTypeObject PyInt_Type 17 17 18 18 .. index:: single: IntType (in modules types) 19 19 20 This instance of :c type:`PyTypeObject` represents the Python plain integer type.20 This instance of :c:type:`PyTypeObject` represents the Python plain integer type. 21 21 This is the same object as ``int`` and ``types.IntType``. 22 22 23 23 24 .. c function:: int PyInt_Check(PyObject *o)24 .. c:function:: int PyInt_Check(PyObject *o) 25 25 26 Return true if *o* is of type :c data:`PyInt_Type` or a subtype of27 :c data:`PyInt_Type`.26 Return true if *o* is of type :c:data:`PyInt_Type` or a subtype of 27 :c:data:`PyInt_Type`. 28 28 29 29 .. versionchanged:: 2.2 … … 31 31 32 32 33 .. c function:: int PyInt_CheckExact(PyObject *o)33 .. c:function:: int PyInt_CheckExact(PyObject *o) 34 34 35 Return true if *o* is of type :c data:`PyInt_Type`, but not a subtype of36 :c data:`PyInt_Type`.35 Return true if *o* is of type :c:data:`PyInt_Type`, but not a subtype of 36 :c:data:`PyInt_Type`. 37 37 38 38 .. versionadded:: 2.2 39 39 40 40 41 .. c function:: PyObject* PyInt_FromString(char *str, char **pend, int base)41 .. c:function:: PyObject* PyInt_FromString(char *str, char **pend, int base) 42 42 43 Return a new :c type:`PyIntObject` or :ctype:`PyLongObject` based on the string43 Return a new :c:type:`PyIntObject` or :c:type:`PyLongObject` based on the string 44 44 value in *str*, which is interpreted according to the radix in *base*. If 45 45 *pend* is non-*NULL*, ``*pend`` will point to the first character in *str* which … … 50 50 must be between ``2`` and ``36``, inclusive. Leading spaces are ignored. If 51 51 there are no digits, :exc:`ValueError` will be raised. If the string represents 52 a number too large to be contained within the machine's :c type:`long int` type53 and overflow warnings are being suppressed, a :c type:`PyLongObject` will be52 a number too large to be contained within the machine's :c:type:`long int` type 53 and overflow warnings are being suppressed, a :c:type:`PyLongObject` will be 54 54 returned. If overflow warnings are not being suppressed, *NULL* will be 55 55 returned in this case. 56 56 57 57 58 .. c function:: PyObject* PyInt_FromLong(long ival)58 .. c:function:: PyObject* PyInt_FromLong(long ival) 59 59 60 60 Create a new integer object with a value of *ival*. … … 67 67 68 68 69 .. c function:: PyObject* PyInt_FromSsize_t(Py_ssize_t ival)69 .. c:function:: PyObject* PyInt_FromSsize_t(Py_ssize_t ival) 70 70 71 71 Create a new integer object with a value of *ival*. If the value is larger … … 76 76 77 77 78 .. c function:: PyObject* PyInt_FromSize_t(size_t ival)78 .. c:function:: PyObject* PyInt_FromSize_t(size_t ival) 79 79 80 80 Create a new integer object with a value of *ival*. If the value exceeds … … 84 84 85 85 86 .. c function:: long PyInt_AsLong(PyObject *io)86 .. c:function:: long PyInt_AsLong(PyObject *io) 87 87 88 Will first attempt to cast the object to a :c type:`PyIntObject`, if it is not88 Will first attempt to cast the object to a :c:type:`PyIntObject`, if it is not 89 89 already one, and then return its value. If there is an error, ``-1`` is 90 90 returned, and the caller should check ``PyErr_Occurred()`` to find out whether … … 92 92 93 93 94 .. c function:: long PyInt_AS_LONG(PyObject *io)94 .. c:function:: long PyInt_AS_LONG(PyObject *io) 95 95 96 96 Return the value of the object *io*. No error checking is performed. 97 97 98 98 99 .. c function:: unsigned long PyInt_AsUnsignedLongMask(PyObject *io)99 .. c:function:: unsigned long PyInt_AsUnsignedLongMask(PyObject *io) 100 100 101 Will first attempt to cast the object to a :c type:`PyIntObject` or102 :c type:`PyLongObject`, if it is not already one, and then return its value as101 Will first attempt to cast the object to a :c:type:`PyIntObject` or 102 :c:type:`PyLongObject`, if it is not already one, and then return its value as 103 103 unsigned long. This function does not check for overflow. 104 104 … … 106 106 107 107 108 .. c function:: unsigned PY_LONG_LONG PyInt_AsUnsignedLongLongMask(PyObject *io)108 .. c:function:: unsigned PY_LONG_LONG PyInt_AsUnsignedLongLongMask(PyObject *io) 109 109 110 Will first attempt to cast the object to a :c type:`PyIntObject` or111 :c type:`PyLongObject`, if it is not already one, and then return its value as110 Will first attempt to cast the object to a :c:type:`PyIntObject` or 111 :c:type:`PyLongObject`, if it is not already one, and then return its value as 112 112 unsigned long long, without checking for overflow. 113 113 … … 115 115 116 116 117 .. c function:: Py_ssize_t PyInt_AsSsize_t(PyObject *io)117 .. c:function:: Py_ssize_t PyInt_AsSsize_t(PyObject *io) 118 118 119 Will first attempt to cast the object to a :c type:`PyIntObject` or120 :c type:`PyLongObject`, if it is not already one, and then return its value as121 :c type:`Py_ssize_t`.119 Will first attempt to cast the object to a :c:type:`PyIntObject` or 120 :c:type:`PyLongObject`, if it is not already one, and then return its value as 121 :c:type:`Py_ssize_t`. 122 122 123 123 .. versionadded:: 2.5 124 124 125 125 126 .. c function:: long PyInt_GetMax()126 .. c:function:: long PyInt_GetMax() 127 127 128 128 .. index:: single: LONG_MAX … … 132 132 133 133 134 .. c function:: int PyInt_ClearFreeList()134 .. c:function:: int PyInt_ClearFreeList() 135 135 136 136 Clear the integer free list. Return the number of items that could not
Note:
See TracChangeset
for help on using the changeset viewer.