Objects/numobjects/intobject/ops_imp_warn

Source   Edit  

Procs

proc PyNumber_AsClampedSsize_t(pyObj: PyObject; res: var int): PyTypeErrorObject {.
    ...raises: [], tags: [RootEffect, WriteIOEffect], forbids: [].}

C: PyNumber_AsSsize_t(pyObj, NULL) clamp result if overflow

returns nil unless Py's TypeError

Source   Edit  
proc PyNumber_AsSsize_t(pyObj: PyObject; excType: PyTypeObject;
                        resExc: var PyBaseErrorObject): int {....raises: [],
    tags: [RootEffect, WriteIOEffect], forbids: [].}

excType may be nil, in which case overflow clamps to low/high int otherwise it must be an exception type

resExc out

CPython's defined at abstract.c

Source   Edit  
proc PyNumber_AsSsize_t(pyObj: PyObject; res: var int): PyExceptionObject {.
    ...raises: [], tags: [RootEffect, WriteIOEffect], forbids: [].}
returns nil if no error; otherwise returns TypeError or OverflowError Source   Edit  

Exports

PyLong_AsSsize_t, toFloat, toFloat, pyIntZero, ==, newPyInt, toIntOrRetOF, hash, powNeg, format, pyIntOne, $, pyIntObjectType, absToUInt, powPos, flipSign, bit_count, toInt, PyLong_FromString, pow, digitPyLong_DECIMAL_BASE, floordivNonZero, retInvIntCall, toUInt, newPyIntFromPtr, PyInt_OverflowCType, round, div, *, PyIntObject, zero, get_max_str_digits, ofExactPyIntObject, positive, divmodNonZero, toInt, newPyIntSimple, PyLong_AsSize_t, divrem, numbits, frexp, toFloat, fromStr, newPyInt, negate, newPyInt, abs, toSomeSignedInt, newPyInt, bit_length, floormodNonZero, divmod, //, toUInt, mod, newPyIntFromPtr, PyLong_AsSize_t, %, <, +, mod, format_binary, toStringCheckThreshold, newPyInt, newPyInt, -, parseInt, sign, ofPyIntObject, toFloat, asLongAndOverflow, toSomeUnsignedInt, newPyInt, PyLong_AsSsize_t, floormod, setSignNegative, n_divmod, digitCount, floordiv, newPyIntFromStr, newPyInt, -, toSomeSignedIntUnsafe, pyIntTen, pow, negative, ceilDiv, or, shr, %, shl, //, -, or, shr, <, ==, <=, +, ==, and, floormod, pow, and, <=, floormod, shl, floordiv, div, divmod, <, *, div, -, floordiv, divmod, xor, ceilDiv, %, //, xor, +, pow, *, mod, mod, newPyIntSimple, digitPyLong_DECIMAL_BASE, shr, not, or, toFloat, pyIntObjectType, negate, ofPyIntObject, toFloat, sign, newPyInt, newPyInt, newPyInt, and, setSignNegative, frexp, shl, newPyIntFromPtr, shl, zero, xor, PyIntObject, toFloat, newPyInt, newPyInt, ofExactPyIntObject, toFloat, newPyIntFromPtr, positive, negative, flipSign, shr, PyNumber_Index, PyNumber_Index, privatePyNumber_Index