Lets
bltinFuncParams {.compileTime.} = @[ident("PyObject"), newIdentDefs( ident("args"), newTree(nnkBracketExpr, [ident("openArray"), ident("PyObject")]), newTree(nnkPrefix, [ident("@"), newTree(nnkBracket, [])])), kwDefs]
- Source Edit
Procs
proc getNameAndArgTypes(prototype: NimNode): (NimNode, NimNode) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc implMethod(prototype, ObjectType, pragmas, body: NimNode; kind: MethodKind): NimNode {. ...raises: [], tags: [], forbids: [].}
- Source Edit
proc registerBltinMethod(t: PyTypeObject; name: string; fun: BltinMethod) {. ...raises: [], tags: [], forbids: [].}
- Source Edit
proc registerBltinMethod(t: PyTypeObject; name: string; fun: BltinMethodDef) {. ...raises: [], tags: [], forbids: [].}
- Source Edit
Macros
macro checkArgTypes(nameAndArg, code: untyped): untyped
- Source Edit
macro declarePyType(prototype, fields: untyped): untyped
-
prototype is of nnkCall format, whose arguments call contains:
- base: BASE
- typeName: TYPE_NAME; TYPE_NAME defaults to lowerAscii of prototype[0]
- tpToken, dict, mutable, reprLock
macro methodMacroTmpl(name: untyped): untyped
- Source Edit
macro reprLockWithMsg(s: string; code: untyped): untyped
- Source Edit
macro reprLockWithMsgExpr(s: untyped; code: untyped): untyped
- used instead of reprLockWithMsg to allow s contains some yet unsolved symbol, like self Source Edit
macro toTypeObject[O: PyObject](tp: typedesc[O]): PyTypeObject
- Source Edit
Templates
template allowSelfReadWhenBeforeRealWrite(body)
- Source Edit
template callMagic(obj: PyObject; methodName: untyped; arg1, arg2: PyObject; handleExcp = false): PyObject
- Source Edit
template castTypeOrRetTE[O: PyObject](obj: PyObject; tp: typedesc[O]; extraArgs: varargs[untyped]): O
- Source Edit
template checkTypeOrRetTE(obj, tp)
- Source Edit
template checkTypeOrRetTE(obj, tp; tpObj: PyTypeObject)
- Source Edit
template checkTypeOrRetTE(obj, tp; tpObj: PyTypeObject; methodName: string)
- example here: For a definition like i: PyIntObject obj: i tp: PyIntObject like tpObj: pyIntObjectType like Source Edit
template genProperty(T, pyname, nname; getter) {.dirty.}
- Source Edit
template genProperty(T; pyname: string; nname; getter, setter) {.dirty.}
- Source Edit
Exports
-
RtArray, newBltinPyType, declareIntFlag, bltinTypes, BinaryMethod, pyDestructorPragma, MagicMethods, PyKwArgType, PyObjectObj, BltinMethod, initRtArray, declareIntFlag, ==, =copy, =wasMoved, callOnceFinalizerFromDealloc, toObjSeq, ofPyTypeObject, =destroy, isClass, getRawData, $, $, PyObjectWithDict, PyObject, toIntFlag, Py_IS, magicNames, ==, PyTypeObject, initRtArray, mro, pyObjectType, BltinMethodDef, forMroNoSelf, pairs, typeToAnyKind, typeName, getDictUnsafe, PY_TPFLAGS, UnaryMethod, []=, TernaryMethod, &, PyTypeToken, or, id, Py_IS_TYPE, items, forMro, BltinFunc, ==, callTpDel, &, iterMro, tp_free, newPyType, len, |, $, typeToAnyKind, IntFlag, initPyMemberDef, destructor, getRORawData, idStr, prepareIntFlagOr, @, getDict, pyCFuncPragma, typeToAnyKind, sizeofIntFlag, typeToAnyKind, isType, hasDict, =trace, pyType, []