此实例的 PyTypeObject represents the Python plain integer type. This is the same object as int and types.IntType .
返回 True 若 o 是类型 PyInt_Type 或子类型的 PyInt_Type .
2.2 版改变: Allowed subtypes to be accepted.
返回 True 若 o 是类型 PyInt_Type ,但不是子类型的 PyInt_Type .
2.2 版新增。
返回新的 PyIntObject or PyLongObject 基于字符串值 str , which is interpreted according to the radix in base 。若 pend 为非 NULL , *pend will point to the first character in str which follows the representation of the number. If base is 0 , the radix will be determined based on the leading characters of str : if str starts with '0x' or '0X' , radix 16 will be used; if str starts with '0' , radix 8 will be used; otherwise radix 10 will be used. If base 不是 0 , it must be between 2 and 36 , inclusive. Leading spaces are ignored. If there are no digits, ValueError will be raised. If the string represents a number too large to be contained within the machine’s long int type and overflow warnings are being suppressed, a PyLongObject will be returned. If overflow warnings are not being suppressed, NULL will be returned in this case.
Create a new integer object with a value of ival .
当前实现保持整数对象数组对于所有整数介于 -5 and 256 ,当在该范围内创建 int 时,实际仅仅返回现有对象的引用。因此,应该可以改变值 1 。怀疑在这种情况下 Python 的行为是未定义的。)
Create a new integer object with a value of ival . If the value is larger than LONG_MAX or smaller than LONG_MIN , a long integer object is returned.
2.5 版新增。
Create a new integer object with a value of ival . If the value exceeds LONG_MAX , a long integer object is returned.
2.5 版新增。
Will first attempt to cast the object to a PyIntObject , if it is not already one, and then return its value. If there is an error, -1 is returned, and the caller should check PyErr_Occurred() to find out whether there was an error, or whether the value just happened to be -1.
Return the value of the object io . No error checking is performed.
Will first attempt to cast the object to a PyIntObject or PyLongObject , if it is not already one, and then return its value as unsigned long. This function does not check for overflow.
2.3 版新增。
Will first attempt to cast the object to a PyIntObject or PyLongObject , if it is not already one, and then return its value as unsigned long long, without checking for overflow.
2.3 版新增。
Will first attempt to cast the object to a PyIntObject or PyLongObject , if it is not already one, and then return its value as Py_ssize_t .
2.5 版新增。
Return the system’s idea of the largest integer it can handle ( LONG_MAX , as defined in the system header files).
Clear the integer free list. Return the number of items that could not be freed.
2.6 版新增。