Skip to content

The argument of invoke should be args ...interface{} #6

@disktnk

Description

@disktnk

so that a user can pass PyObject or other raw Python values to functions. I think we can just use reflect for now instead of providing a higher level value type something like:

type Value interface {
  ...
}

type RawValue data.Value

... supporting the Value interface in PyObject, etc..

Ideally, we should provide func convertArgsGo2Py(args ...interface{}) (Object, error) { and func invoke(pyObj *C.PyObject, name string, args Object) (data.Value, error) {. Unlike the current invoke, the new invoke doesn't perform argument type conversion so that it becomes easier for users to distinguish type conversion errors and other runtime errors. We can, of course, provide a wrapper function which behaves like the current invoke.

When providing this function, be careful of defining DecRef rules as mentioned in #5 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions