Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
disktnk opened this issue Mar 11, 2016 · 0 comments
Open

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

disktnk opened this issue Mar 11, 2016 · 0 comments

Comments

@disktnk
Copy link
Member

disktnk commented Mar 11, 2016

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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant