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, asUTF8, pyStopIterationObjectType, PyRuntimeErrorObject, ==, pyImportErrorObjectType, newUnicodeUnicodeVariant, $, pyIntObjectType, newPyFloatSimple, TwoDigits, asUTF8, newBaseError, newModuleNotFoundError, pyObjectType, newZeroDivisionError, pyKeyErrorObjectType, TernaryMethod, PyBaseErrorObject, PyTypeToken, id, eqAscii, ofExactPyExceptionObject, newPyKeyboardInterruptSimple, ofExactPyNameErrorObject, newOverflowError, Digit, zero, newValueError, typeToAnyKind, newPyAssertionErrorSimple, ofPySyntaxErrorObject, ofExactPyMemoryErrorObject, newPyIntSimple, repr, newPyFloat, PyKeyboardInterruptObject, pyBoolObjectType, ofExactPyNotImplementedErrorObject, newPyNameErrorSimple, ofExactPyIndexErrorObject, pyStopIterErrorObjectType, PyNotImplementedErrorObject, genProperty, &, pyZeroDivisionErrorObjectType, allowSelfReadWhenBeforeRealWrite, PyLong_DECIMAL_SHIFT, PyEOFErrorObject, retZeroDiv, PyExceptionObject, pyBufferErrorObjectType, itemSize, toTypeObject, castTypeOrRetTE, PyArg_NoKw, PyMemoryErrorObject, ofPyStrObject, newPyInt, getNameAndArgTypes, newAsciiUnicodeVariantOfCap, newModuleNotFoundError, =trace, ofPyZeroDivisionErrorObject, newPyIOErrorSimple, ofPyBoolObject, $, frexp, newUnicodeVariant, pyFloatObjectType, newStopIterError, toFloat, ofPyFloatObject, PyKwArgType, newImportError, newSystemExit, PyStrObject, UnaryMethod, newZeroDivisionError, newPyRuntimeErrorSimple, getDictUnsafe, ofExactPySyntaxErrorObject, ofExactPyLockErrorObject, forMro, callMagic, pyModuleNotFoundErrorObjectType, implMethod, newPyMemoryErrorSimple, len, newPyAscii, newTypeError, retIfExc, Py_CheckSlotResult, newPyNotImplementedObjectMagic, doKindsWith2It, methodMacroTmpl, newPyString, pyLockErrorObjectType, ofExactPyArithmeticErrorObject, isPyTrue, newBaseError, ofPyRecursionErrorObject, isThrownException, PyUnicode_READ, getBltinName, ofPyLookupErrorObject, $, IntSign, pyAttributeErrorObjectType, forMroNoSelf, pyTypeErrorObjectType, isAscii, pyAssertionErrorObjectType, PyModuleNotFoundErrorObject, newArithmeticError, newPyAscii, getBltinName, &, newImportError, add, newOverflowError, RtArray, &, SDigit, ofExactPyOverflowErrorObject, pyDestructorPragma, newPySystemExitSimple, ofPyBufferErrorObject, ofExactPyIOErrorObject, ofExactPyStopIterErrorObject, getIterableWithCheck, newUnboundLocalError, newValueError, PyNotImplementedObject, pyUnboundLocalErrorObjectType, newUnicodeVariant, newLookupError, fastCopyCharacters, ofPyStopIterErrorObject, digitPyLong_DECIMAL_BASE, PyUnboundLocalErrorObject, newRecursionError, newKeyboardInterrupt, pyArithmeticErrorObjectType, ofExactPyKeyboardInterruptObject, BltinFunc, newKeyError, errorIfNotBool, reprLockWithMsgExpr, tp_free, newRuntimeError, PyZeroDivisionErrorObject, newPyNotImplementedSimple, newGeneratorExit, registerBltinMethod, newBufferError, len, joinAsRunes, subErrs, ofPyMemoryErrorObject, kind, isExceptionOf, pyOSErrorObjectType, newPyInt, PySyntaxErrorObject, UnicodeVariant, newPyOverflowErrorSimple, callMagic, newPyFloat, PyAssertionErrorObject, PyIndexErrorObject, checkArgNum, errArgNum, callTpDel, newEOFError, typeName, newPyStopIterErrorSimple, PyArithmeticErrorObject, newUnicodeVariant, ofPyIntObject, ofExactPyOSErrorObject, newNotImplementedError, pyIntOne, pyLookupErrorObjectType, negative, newBaseException, newMemoryError, ofPyKeyboardInterruptObject, PyBaseExceptionObject, PyBufferErrorObject, newSyntaxError, pyExceptionObjectType, newPyUnboundLocalErrorSimple, newPyImportErrorSimple, ofExactPyModuleNotFoundErrorObject, newLockError, ofExactPyKeyErrorObject, newAttributeError, isClass, toRunes, newPyStr, PyLong_SHIFT, bltinFuncParams, ofExactPyZeroDivisionErrorObject, genProperty, ofPyAssertionErrorObject, newLookupError, pyNotImplementedErrorObjectType, PyTypeErrorObject, newOSError, checkArgNumAtLeast, PyImportErrorObject, &, newStopIterError, pyRuntimeErrorObjectType, reprLock, newUnicodeOrAsciiUnicodeVariant, MagicMethods, newKeyboardInterrupt, pyIntTen, newPyKeyErrorSimple, =destroy, pyNotImplemented, getMagic, newUnicodeUnicodeVariant, newAssertionError, mutable, pyBaseExceptionObjectType, hasDict, pySystemErrorObjectType, $, PyKeyErrorObject, tpGetter, newTypeError, PySystemExitObject, newPyStrSimple, ofExactPyFloatObject, ofExactPyTypeErrorObject, pySystemExitObjectType, newAssertionError, checkArgNumAtMost, newPyBool, retIfExc, ofExactPyRecursionErrorObject, isType, PyRecursionErrorObject, PyAttributeErrorObject, Py_CheckSlotResult, hash, ofPyEOFErrorObject, TraceBack, newPySystemErrorSimple, isStopIter, errorIfNot, ofExactPyBaseExceptionObject, mro, newNameError, ofExactPyRuntimeErrorObject, tpMagic, data, tpSetter, newGeneratorExit, pyIOErrorObjectType, callInplaceMagic, ofExactPyLookupErrorObject, ofPyIOErrorObject, checkConsistency, PyOSErrorObject, getRORawData, newPyGeneratorExitSimple, newSystemError, ofPyExceptionObject, hash, ofPyRuntimeErrorObject, PyErr_Format, initRtArray, newPyBaseErrorSimple, checkTypeOrRetTE, magicNames, ofPyOSErrorObject, toObjSeq, ExceptionToken, ofExactPyEOFErrorObject, ofExactPyValueErrorObject, newPyBoolSimple, pyValueErrorObjectType, newUnicodeUnicodeVariant, newPyInt, ==, ofPyLockErrorObject, pyOverflowErrorObjectType, newIndexTypeError, typeToAnyKind, initPyMemberDef, reprLockWithMsg, $, PyStopIterErrorObject, errorIfNot, newAsciiUnicodeVariant, ofExactPyNotImplementedObject, toFloat, toFloat, newIOError, pyEOFErrorObjectType, ofExactPyBufferErrorObject, callMagic, asUTF8AndSize, tpMethod, $, ofExactPySystemErrorObject, PyLong_DECIMAL_BASE, PyDictObject, ofExactPySystemExitObject, ofExactPyGeneratorExitObject, PyTypeObject, ofExactPyIntObject, newBufferError, checkArgNum, newUnicodeVariant, idStr, pyBaseErrorObjectType, ofPyModuleNotFoundErrorObject, $, newAttributeError, PyNameErrorObject, truncate, pyCFuncPragma, pyNotImplementedObjectType, pyType, positive, pyIntZero, PySystemErrorObject, pyFalseObj, PyObjectObj, BltinMethod, callOnceFinalizerFromDealloc, PyBoolObject, newUnboundLocalError, initRtArray, pairs, checkTypeOrRetTE, PyObject, MAX_UNICODE, newRecursionError, getDict, PyLockErrorObject, newAsciiUnicodeVariant, reprPyNotImplementedObjectMagic, ofExactPyUnboundLocalErrorObject, setSignNegative, [], newAttributeError, iterMro, pyGeneratorExitObjectType, PyOverflowErrorObject, newPyLockErrorSimple, newPyEOFErrorSimple, PyGeneratorExitObject, newUnicodeVariant, ofPyImportErrorObject, newPyString, ofPyValueErrorObject, isNotImplemented, ofPyOverflowErrorObject, ofPyIndexErrorObject, newSystemError, newPyBufferErrorSimple, newPyString, ofPyKeyErrorObject, ofExactPyImportErrorObject, BltinMethodDef, PyStopIterationObject, newPyExceptionSimple, null_error, pyIndexErrorObjectType, registerBltinMethod, ofPyBaseExceptionObject, newNotImplementedError, errorIfNotString, newSystemExit, ofPyGeneratorExitObject, ofExactPyStrObject, newRuntimeError, PyIntObject, pySyntaxErrorObjectType, newPyAttributeErrorSimple, newIndexError, newBaseException, newPyFloat, newMemoryError, negate, ofPyNotImplementedObject, =copy, ofPyNotImplementedErrorObject, ofExactPyAssertionErrorObject, newNameError, newUnicodeUnicodeVariantOfCap, Py_IS, newPyTypeErrorSimple, newIndexError, newPyString, ofPyAttributeErrorObject, newOSError, ==, newPyValueErrorSimple, newPyOSErrorSimple, pyMemoryErrorObjectType, newPyRecursionErrorSimple, pyStrObjectType, len, doBothKindOk, pyTrueObj, destructor, ofPyUnboundLocalErrorObject, newEOFError, digitBits, checkArgTypes, newSyntaxError, newPyIndexErrorSimple, asUTF8AndSize, newLockError, BinaryMethod, items, newPyInt, checkTypeOrRetTE, newPyBaseExceptionSimple, newArithmeticError, ofPySystemExitObject, newPyNotImplementedErrorSimple, Py_IS_TYPE, castSelf, flipSign, newPyZeroDivisionErrorSimple, cmpAscii, newPyModuleNotFoundErrorSimple, declarePyType, newPySyntaxErrorSimple, typeToAnyKind, ofExactPyBoolObject, newKeyError, newIOError, ofPyNameErrorObject, @, PyFloatObject, PyArg_NoKw, ofPyArithmeticErrorObject, PyLookupErrorObject, PyValueErrorObject, pyKeyboardInterruptObjectType, newPyLookupErrorSimple, =wasMoved, getTokenName, ofPyTypeErrorObject, getRawData, newPyType, ofPyTypeObject, pyRecursionErrorObjectType, newPyString, newPyStr, itemSize, PyIOErrorObject, ofPySystemErrorObject, newPyStopIterationSimple, PyObjectWithDict, ofExactPyAttributeErrorObject, [], getFun, []=, newPyArithmeticErrorSimple, pyNameErrorObjectType