Objects/numobjects/numobjects_comm_with_warn

Source   Edit  

Procs

proc privatePyNumber_Index(item: PyObject): PyObject {.cdecl, ...raises: [],
    tags: [RootEffect, WriteIOEffect], forbids: [].}

_PyNumber_Index

returns PyIntObject(or its subtype with a warning) or exception

CPython's defined at abstract.c

Source   Edit  
proc PyNumber_Index(item: PyObject): PyObject {.cdecl, ...raises: [],
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Return an exact Python int from the object item. Raise TypeError if the result is not an int or if the object cannot be interpreted as an index. Source   Edit  
proc PyNumber_Index(item: PyObject; res: var PyIntObject): PyBaseErrorObject {.
    cdecl, ...raises: [], tags: [RootEffect, WriteIOEffect], forbids: [].}
  • returns nil if no error;
  • returns TypeError or other exceptions raised by item.__index__
Source   Edit  

Templates

template PyNumber_Xxx_Wrap[Py: PyObject](o: PyObject; magicPureId, typeId;
    prePureFuncName: string; resTypeNameMaxLen: int; resObj: var Py) {.dirty.}
Source   Edit  

Exports

bltinTypes, PyProcessLookupErrorObject, PyPermissionErrorObject, newPyFloatSimple, asUTF8, newPyBrokenPipeErrorSimple, PyRuntimeErrorObject, PyBaseErrorObject, pyImportErrorObjectType, newUnicodeUnicodeVariant, $, pyIntObjectType, TwoDigits, asUTF8, newBaseError, newModuleNotFoundError, [], pyObjectType, newZeroDivisionError, pyKeyErrorObjectType, TernaryMethod, PyTypeToken, id, ofExactPyStopIterErrorObject, PyUnicode_READ, bltinFuncParams, PyUnicodeDecodeErrorObject, getBltinName, ofExactPyNameErrorObject, newOverflowError, Digit, pyUnicodeErrorObjectType, newValueError, PyNotADirectoryErrorObject, typeToAnyKind, newPyAssertionErrorSimple, ofPySyntaxErrorObject, newPyIntSimple, pyStopIterationObjectType, IntFlag, pyBoolObjectType, ofExactPyNotImplementedErrorObject, newPyRecursionErrorSimple, ofExactPyIndexErrorObject, pyStopIterErrorObjectType, PySyntaxErrorObject, genProperty, $, PyGeneratorExitObject, pyNotImplementedErrorObjectType, newPyBlockingIOErrorSimple, pyZeroDivisionErrorObjectType, len, allowSelfReadWhenBeforeRealWrite, PyEOFErrorObject, retZeroDiv, PyExceptionObject, ofExactPyZeroDivisionErrorObject, itemSize, ofPyUnicodeEncodeErrorObject, newPyKeyboardInterruptSimple, toTypeObject, ofExactPyLockErrorObject, castTypeOrRetTE, PyArg_NoKw, newAsciiUnicodeVariant, ofExactPyNotImplementedObject, PyMemoryErrorObject, pySystemExitObjectType, newPyInt, getNameAndArgTypes, newAsciiUnicodeVariantOfCap, ofPyBlockingIOErrorObject, or, newModuleNotFoundError, ofPyRuntimeErrorObject, =trace, UnicodeVariant, ofPyZeroDivisionErrorObject, ofPyBoolObject, $, newPyStopAsyncIterErrorSimple, newReferenceError, frexp, subErrs, pyFloatObjectType, PyPythonFinalizationErrorObject, toFloat, PyObject, toFloat, ofExactPyEOFErrorObject, ofPyFloatObject, pyIntZero, PyKwArgType, pyPermissionErrorObjectType, newSystemExit, PyStopAsyncIterationObject, PyStrObject, UnaryMethod, newZeroDivisionError, newPyRuntimeErrorSimple, newArithmeticError, getDictUnsafe, ofExactPySyntaxErrorObject, forMro, callMagic, newPyUnicodeDecodeErrorSimple, ==, ofPyUnicodeTranslateErrorObject, newPyAscii, newTypeError, retIfExc, Py_CheckSlotResult, ofExactPyFileExistsErrorObject, newPyNotImplementedObjectMagic, newPyConnectionRefusedErrorSimple, doKindsWith2It, newPyKeyErrorSimple, methodMacroTmpl, newPyString, pyLockErrorObjectType, newPythonFinalizationError, pyTimeoutErrorObjectType, ofExactPyPermissionErrorObject, isPyTrue, repr, eqAscii, $, newBaseError, ofPyRecursionErrorObject, isThrownException, ofExactPyExceptionObject, ofExactPyConnectionAbortedErrorObject, ofPyLookupErrorObject, ofExactPyConnectionErrorObject, IntSign, pyAttributeErrorObjectType, newKeyboardInterrupt, forMroNoSelf, newOSError, isAscii, pyAssertionErrorObjectType, newPyReferenceErrorSimple, pyInterruptedErrorObjectType, ofPyReferenceErrorObject, newPyConnectErrorSimple, &, pyConnectionErrorObjectType, newPyConnectionResetErrorSimple, len, newPyUnicodeEncodeErrorSimple, pyFileExistsErrorObjectType, getBltinName, PyKeyboardInterruptObject, pyIntTen, ==, ofPyBrokenPipeErrorObject, PyFileNotFoundErrorObject, newOverflowError, RtArray, newEOFError, PyTypeObject, ofExactPyOverflowErrorObject, pyDestructorPragma, PyBrokenPipeErrorObject, ofExactPyBrokenPipeErrorObject, newStopIterError, ofPyBufferErrorObject, ==, len, ofExactPyIOErrorObject, newBufferError, getIterableWithCheck, ofPyStrObject, ofPyExceptionClass, PyArithmeticErrorObject, newValueError, PyNotImplementedObject, newPyFileExistsErrorSimple, pyChildProcessErrorObjectType, pyUnboundLocalErrorObjectType, newUnicodeVariant, PyIndentationErrorObject, ofPyFileExistsErrorObject, PyModuleNotFoundErrorObject, newPyChildProcessErrorSimple, digitPyLong_DECIMAL_BASE, PyUnboundLocalErrorObject, newKeyboardInterrupt, pyArithmeticErrorObjectType, ofExactPyKeyboardInterruptObject, newPySystemExitSimple, newPyNameErrorSimple, errorIfNotBool, reprLockWithMsgExpr, tp_free, pyStrObjectType, newRuntimeError, PyZeroDivisionErrorObject, ofPyIndentationErrorObject, &, ofExactPyUnicodeEncodeErrorObject, PyLong_DECIMAL_BASE, newPyNotImplementedSimple, ofExactPyConnectErrorObject, pyBufferErrorObjectType, newBufferError, joinAsRunes, newPyStopAsyncIterationSimple, ofPyMemoryErrorObject, kind, isExceptionOf, pyOSErrorObjectType, newPyInt, PyLong_DECIMAL_SHIFT, newPyOverflowErrorSimple, callMagic, pyBlockingIOErrorObjectType, PyIndexErrorObject, checkArgNum, errArgNum, PyTimeoutErrorObject, newUnboundLocalError, typeName, ofPyBaseExceptionGroupObject, newPyTimeoutErrorSimple, newUnicodeVariant, ofPyIntObject, PyFloatingPointErrorObject, ofExactPyOSErrorObject, newNotImplementedError, pyIntOne, pyLookupErrorObjectType, newBaseException, $, ofPyKeyboardInterruptObject, newPyInterruptedErrorSimple, newImportError, PyBaseExceptionObject, ofPyNotADirectoryErrorObject, newSyntaxError, pyExceptionObjectType, newPyUnboundLocalErrorSimple, newPyImportErrorSimple, ofExactPyModuleNotFoundErrorObject, declareIntFlag, newLockError, ofExactPyKeyErrorObject, isClass, PyChildProcessErrorObject, toRunes, ofPyTypeObject, fastCopyCharacters, newPyMemoryErrorSimple, ofPyStopIterErrorObject, ofExactPyMemoryErrorObject, PyLong_SHIFT, newLookupError, newBaseExceptionGroup, PY_TPFLAGS, newReferenceError, genProperty, ofPyAssertionErrorObject, ofPyConnectionErrorObject, PyNotImplementedErrorObject, newPyIntFromPtr, pySyntaxErrorObjectType, newPyBaseErrorSimple, newPyFloatingPointErrorSimple, PyTypeErrorObject, newMemoryError, PyStopAsyncIterErrorObject, newStopAsyncIterError, newPyExceptionSimple, checkArgNumAtLeast, PyImportErrorObject, PyUnicodeEncodeErrorObject, pyFloatingPointErrorObjectType, pyRuntimeErrorObjectType, sizeofIntFlag, implMethod, reprLock, ofExactPyIntObject, newUnicodeOrAsciiUnicodeVariant, ofExactPyUnicodeErrorObject, newPyBaseExceptionGroupSimple, MagicMethods, ofPyFloatingPointErrorObject, ofPyStopAsyncIterErrorObject, ofExactPyFileNotFoundErrorObject, ofPyChildProcessErrorObject, ofPyProcessLookupErrorObject, ofPyExceptionClass, =destroy, pyNotImplemented, getMagic, newUnicodeUnicodeVariant, BltinFunc, ofPyTimeoutErrorObject, mutable, ofExactPyUnicodeDecodeErrorObject, pyBaseExceptionObjectType, hasDict, newStopIterError, newKeyError, PyTabErrorObject, pySystemErrorObjectType, PyKeyErrorObject, tpGetter, newTypeError, declareIntFlag, PySystemExitObject, newPyStrSimple, ofExactPyFloatObject, ofExactPyTypeErrorObject, newBaseExceptionGroup, newPyIOErrorSimple, ofPyInterruptedErrorObject, ofExactPyConnectionRefusedErrorObject, newAssertionError, checkArgNumAtMost, pyBrokenPipeErrorObjectType, newPyBool, retIfExc, ofExactPyRecursionErrorObject, isType, newFloatingPointError, ofPyConnectionAbortedErrorObject, PyRecursionErrorObject, PyAttributeErrorObject, newPyZeroDivisionErrorSimple, newStopAsyncIterError, PyIsADirectoryErrorObject, newAttributeError, newNameError, hash, newPyConnectionAbortedErrorSimple, $, pyUnicodeDecodeErrorObjectType, newPyType, ofPyEOFErrorObject, ofPyOSErrorObject, newPySystemErrorSimple, zero, ofPyNotImplementedObject, isStopIter, errorIfNot, newPyLookupErrorSimple, pyIOErrorObjectType, newNameError, ofExactPyRuntimeErrorObject, tpMagic, data, tpSetter, newGeneratorExit, callInplaceMagic, &, newPyPythonFinalizationErrorSimple, checkConsistency, reprPyNotImplementedObjectMagic, PyOSErrorObject, getRORawData, newSystemError, ofPyExceptionObject, newFloatingPointError, pyStopAsyncIterErrorObjectType, newBltinPyType, toIntFlag, ofExactPyLookupErrorObject, initRtArray, ofExactPyIndentationErrorObject, newPyInt, checkTypeOrRetTE, pyFileNotFoundErrorObjectType, magicNames, newGeneratorExit, BltinMethodDef, ExceptionToken, ofExactPyValueErrorObject, newPyBoolSimple, PyConnectionErrorObject, pyValueErrorObjectType, pyIndentationErrorObjectType, newUnicodeUnicodeVariant, ofExactPyUnicodeTranslateErrorObject, newPyInt, newPyFileNotFoundErrorSimple, &, ofPyLockErrorObject, newIndexTypeError, typeToAnyKind, initPyMemberDef, PyInterruptedErrorObject, newKeyError, pyOverflowErrorObjectType, PyStopIterErrorObject, errorIfNot, newAsciiUnicodeVariant, newUnicodeVariant, $, toFloat, newIOError, pyEOFErrorObjectType, ofPyNameErrorObject, callMagic, ofPyExceptionInstance, pyBaseExceptionGroupObjectType, newPyFloat, tpMethod, ofExactPySystemErrorObject, PyAssertionErrorObject, ofExactPyBaseExceptionObject, PyDictObject, ofExactPySystemExitObject, ofExactPyGeneratorExitObject, ofExactPyUnboundLocalErrorObject, SDigit, checkArgNum, pyConnectionAbortedErrorObjectType, newUnicodeVariant, idStr, ofExactPyConnectionResetErrorObject, newAttributeError, pyStopAsyncIterationObjectType, pyBaseErrorObjectType, pyProcessLookupErrorObjectType, registerBltinMethod, errorIfNotString, PyUnicodeErrorObject, callTpDel, pyConnectionRefusedErrorObjectType, PyNameErrorObject, ofExactPyStopAsyncIterErrorObject, truncate, ofPyArithmeticErrorObject, pyCFuncPragma, pyNotImplementedObjectType, pyModuleNotFoundErrorObjectType, ==, positive, newPyTypeErrorSimple, PySystemErrorObject, newConnectError, ofExactPyProcessLookupErrorObject, pyUnicodeTranslateErrorObjectType, pyFalseObj, PyObjectObj, BltinMethod, callOnceFinalizerFromDealloc, ofExactPyNotADirectoryErrorObject, ofPyIsADirectoryErrorObject, PyBoolObject, newUnboundLocalError, PyFileExistsErrorObject, initRtArray, pairs, checkTypeOrRetTE, ofExactPyFloatingPointErrorObject, toObjSeq, MAX_UNICODE, newRecursionError, newPyPermissionErrorSimple, getDict, PyLockErrorObject, newPyStopIterErrorSimple, newPyIsADirectoryErrorSimple, ofPyPythonFinalizationErrorObject, ofExactPyTabErrorObject, setSignNegative, newAttributeError, iterMro, pyGeneratorExitObjectType, prepareIntFlagOr, newPyLockErrorSimple, newPyConnectionErrorSimple, mro, newUnicodeVariant, pyPythonFinalizationErrorObjectType, ofPyImportErrorObject, newPyOSErrorSimple, newPyString, isNotImplemented, ofPyOverflowErrorObject, newLookupError, add, newPyTabErrorSimple, ofPyIndexErrorObject, pyTabErrorObjectType, ofPyConnectionResetErrorObject, newSystemError, newEOFError, newPyString, ofPyValueErrorObject, ofExactPyImportErrorObject, PyStopIterationObject, PyUnicodeTranslateErrorObject, registerBltinMethod, ofPyBaseExceptionObject, pyUnicodeEncodeErrorObjectType, PyBaseExceptionGroupObject, pyIsADirectoryErrorObjectType, newSystemExit, ofPyIOErrorObject, ofPyTabErrorObject, getTokenName, ofExactPyStrObject, PyConnectionAbortedErrorObject, negative, newPyUnicodeErrorSimple, newPyBufferErrorSimple, PyIntObject, newPyAttributeErrorSimple, newIndexError, PyConnectionResetErrorObject, $, newPyGeneratorExitSimple, newBaseException, PyOverflowErrorObject, pyConnectionResetErrorObjectType, PyConnectionRefusedErrorObject, newPyFloat, newMemoryError, newPyStr, newConnectError, negate, hash, =copy, ofPyNotImplementedErrorObject, newPyProcessLookupErrorSimple, ofPyFileNotFoundErrorObject, ofExactPyAssertionErrorObject, newUnicodeUnicodeVariantOfCap, PyErr_Format, Py_IS, ofExactPyPythonFinalizationErrorObject, Py_CheckSlotResult, PyIOErrorObject, newPyUnicodeTranslateErrorSimple, newPyString, newPythonFinalizationError, ofExactPyArithmeticErrorObject, ofPyAttributeErrorObject, pyTypeErrorObjectType, ofExactPyTimeoutErrorObject, &, ofPyKeyErrorObject, newImportError, newPyValueErrorSimple, pyConnectErrorObjectType, PyBufferErrorObject, ofExactPyBaseExceptionGroupObject, pyMemoryErrorObjectType, PyConnectErrorObject, asUTF8AndSize, doBothKindOk, pyTrueObj, destructor, ofPyUnboundLocalErrorObject, [], digitBits, checkArgTypes, &, newSyntaxError, newPyIndexErrorSimple, asUTF8AndSize, newLockError, BinaryMethod, items, ==, newPyIntFromPtr, null_error, newPyAscii, checkTypeOrRetTE, newPyBaseExceptionSimple, newArithmeticError, pyIndexErrorObjectType, ofPySystemExitObject, newRecursionError, newPyNotImplementedErrorSimple, Py_IS_TYPE, ofPyPermissionErrorObject, castSelf, flipSign, newNotImplementedError, cmpAscii, newPyModuleNotFoundErrorSimple, newAssertionError, newPyFloat, declarePyType, pyNotADirectoryErrorObjectType, newPySyntaxErrorSimple, typeToAnyKind, []=, ofExactPyBoolObject, reprLockWithMsg, newIOError, ofExactPyBufferErrorObject, @, PyFloatObject, PyArg_NoKw, PyBlockingIOErrorObject, newPyEOFErrorSimple, pyType, PyLookupErrorObject, PyValueErrorObject, ofExactPyIsADirectoryErrorObject, pyKeyboardInterruptObjectType, |, =wasMoved, ofPyGeneratorExitObject, ofExactPyChildProcessErrorObject, ofPyTypeErrorObject, getRawData, ofExactPyBlockingIOErrorObject, privateGetTracebackRef=, newPyNotADirectoryErrorSimple, ofExactPyInterruptedErrorObject, pyRecursionErrorObjectType, newPyString, newPyStr, itemSize, newIndexError, ofPyUnicodeDecodeErrorObject, newOSError, ofPySystemErrorObject, newPyStopIterationSimple, newPyIndentationErrorSimple, pyReferenceErrorObjectType, PyObjectWithDict, ofExactPyAttributeErrorObject, ofPyConnectErrorObject, getFun, ofPyConnectionRefusedErrorObject, newRuntimeError, BaseExceptionToken, privateGetTracebackRef, typeToAnyKind, ofExactPyReferenceErrorObject, newPyArithmeticErrorSimple, pyNameErrorObjectType, PyReferenceErrorObject, ofPyUnicodeErrorObject, ofPyModuleNotFoundErrorObject