Objects/pyobject

Search:
Group by:
Source   Edit  

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 castSelf(ObjectType: untyped; code: untyped): untyped
Source   Edit  
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
Source   Edit  
macro methodMacroTmpl(name: untyped): untyped
Source   Edit  
macro mutable(kind, code: untyped): untyped
Source   Edit  
macro reprLock(code: 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  
macro tpGetter(tp, methodName: untyped): untyped
Source   Edit  
macro tpMagic(tp, methodName: untyped): untyped
Source   Edit  
macro tpMethod(tp, methodName: untyped): untyped
Source   Edit  
macro tpSetter(tp, methodName: untyped): untyped
Source   Edit  

Templates

template callInplaceMagic(obj: PyObject; methodName1: untyped; arg1: PyObject;
                          handleExcp = false): PyObject
Source   Edit  
template callMagic(obj: PyObject; methodName: untyped; arg1, arg2: PyObject;
                   handleExcp = false): PyObject
Source   Edit  
template callMagic(obj: PyObject; methodName: untyped; arg1: PyObject;
                   handleExcp = false): PyObject
Source   Edit  
template callMagic(obj: PyObject; methodName: untyped; 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  
template getFun(obj: PyObject; methodName: untyped; handleExcp = false): untyped
Source   Edit  
template getMagic(obj: PyObject; methodName): untyped
Source   Edit