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, bltinTypes, BinaryMethod, pyDestructorPragma, MagicMethods, PyKwArgType, PyObjectObj, BltinMethod, initRtArray, ==, =copy, =wasMoved, callOnceFinalizerFromDealloc, hasDict, =destroy, isClass, getRawData, $, $, PyObjectWithDict, PyObject, Py_IS_TYPE, Py_IS, magicNames, PyTypeObject, initRtArray, mro, pyObjectType, BltinMethodDef, pairs, forMroNoSelf, typeName, newPyType, getDictUnsafe, UnaryMethod, []=, TernaryMethod, typeToAnyKind, PyTypeToken, id, items, forMro, BltinFunc, callTpDel, typeToAnyKind, iterMro, tp_free, len, idStr, typeToAnyKind, initPyMemberDef, destructor, getRORawData, toObjSeq, @, getDict, pyCFuncPragma, isType, ofPyTypeObject, =trace, pyType, []