All integers are implemented as “long” integer objects of arbitrary size.
This instance ofPyTypeObject represents the Python integer type.This is the same object asint in the Python layer.
Return true if its argument is aPyLongObject or a subtype ofPyLongObject.
Return true if its argument is aPyLongObject, but not a subtype ofPyLongObject.
Return a newPyLongObject object fromv, orNULL on failure.
The current implementation keeps an array of integer objects for all integersbetween-5 and256, when you create an int in that range you actuallyjust get back a reference to the existing object. So it should be possible tochange the value of1. I suspect the behaviour of Python in this case isundefined. :-)
Return a newPyLongObject object from a Cunsignedlong, orNULL on failure.
Return a newPyLongObject object from a CPy_ssize_t, orNULL on failure.
Return a newPyLongObject object from a Csize_t, orNULL on failure.
Return a newPyLongObject object from a Clonglong, orNULLon failure.
Return a newPyLongObject object from a Cunsignedlonglong,orNULL on failure.
Return a newPyLongObject object from the integer part ofv, orNULL on failure.
Return a newPyLongObject based on the string value instr, whichis interpreted according to the radix inbase. Ifpend is non-NULL,*pend will point to the first character instr which follows therepresentation of the number. Ifbase is0, the radix will bedetermined based on the leading characters ofstr: ifstr starts with'0x' or'0X', radix 16 will be used; ifstr starts with'0o' or'0O', radix 8 will be used; ifstr starts with'0b' or'0B',radix 2 will be used; otherwise radix 10 will be used. Ifbase is not0, it must be between2 and36, inclusive. Leading spaces areignored. If there are no digits,ValueError will be raised.
Convert a sequence of Unicode digits to a Python integer value. The Unicodestring is first encoded to a byte string usingPyUnicode_EncodeDecimal()and then converted usingPyLong_FromString().
Deprecated since version 3.3, will be removed in version 4.0:Part of the old-stylePy_UNICODE API; please migrate to usingPyLong_FromUnicodeObject().
Convert a sequence of Unicode digits in the stringu to a Python integervalue. The Unicode string is first encoded to a byte string usingPyUnicode_EncodeDecimal() and then converted usingPyLong_FromString().
New in version 3.3.
Create a Python integer from the pointerp. The pointer value can beretrieved from the resulting value usingPyLong_AsVoidPtr().
Return a Clong representation ofobj. Ifobj is not aninstance ofPyLongObject, first call its__int__() method(if present) to convert it to aPyLongObject.
RaiseOverflowError if the value ofobj is out of range for along.
Return a Clong representation ofobj. Ifobj is not aninstance ofPyLongObject, first call its__int__() method(if present) to convert it to aPyLongObject.
If the value ofobj is greater thanLONG_MAX or less thanLONG_MIN, set*overflow to1 or-1, respectively, andreturn-1; otherwise, set*overflow to0. If any other exceptionoccurs set*overflow to0 and return-1 as usual.
Return a Clonglong representation ofobj. Ifobj is not aninstance ofPyLongObject, first call its__int__() method(if present) to convert it to aPyLongObject.
RaiseOverflowError if the value ofobj is out of range for along.
Return a Clonglong representation ofobj. Ifobj is not aninstance ofPyLongObject, first call its__int__() method(if present) to convert it to aPyLongObject.
If the value ofobj is greater thanPY_LLONG_MAX or less thanPY_LLONG_MIN, set*overflow to1 or-1, respectively,and return-1; otherwise, set*overflow to0. If any otherexception occurs set*overflow to0 and return-1 as usual.
New in version 3.2.
Return a CPy_ssize_t representation ofpylong.pylong mustbe an instance ofPyLongObject.
RaiseOverflowError if the value ofpylong is out of range for aPy_ssize_t.
Return a Cunsignedlong representation ofpylong.pylongmust be an instance ofPyLongObject.
RaiseOverflowError if the value ofpylong is out of range for aunsignedlong.
Return a Csize_t representation ofpylong.pylong must bean instance ofPyLongObject.
RaiseOverflowError if the value ofpylong is out of range for asize_t.
Return a CunsignedPY_LONG_LONG representation ofpylong.pylong must be an instance ofPyLongObject.
RaiseOverflowError if the value ofpylong is out of range for anunsignedPY_LONG_LONG.
Changed in version 3.1:A negativepylong now raisesOverflowError, notTypeError.
Return a Cunsignedlong representation ofobj. Ifobjis not an instance ofPyLongObject, first call its__int__()method (if present) to convert it to aPyLongObject.
If the value ofobj is out of range for anunsignedlong,return the reduction of that value moduloULONG_MAX+1.
Return a Cunsignedlonglong representation ofobj. Ifobjis not an instance ofPyLongObject, first call its__int__()method (if present) to convert it to aPyLongObject.
If the value ofobj is out of range for anunsignedlonglong,return the reduction of that value moduloPY_ULLONG_MAX+1.
Return a Cdouble representation ofpylong.pylong must bean instance ofPyLongObject.
RaiseOverflowError if the value ofpylong is out of range for adouble.
Convert a Python integerpylong to a Cvoid pointer.Ifpylong cannot be converted, anOverflowError will be raised. Thisis only assured to produce a usablevoid pointer for values createdwithPyLong_FromVoidPtr().
Enter search terms or a module, class or function name.