-
Notifications
You must be signed in to change notification settings - Fork 189
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
Support for named tuples #175
Comments
If you want to leave it as a Python object, you can do so by using |
Julia doesn't have named tuples, so the alternatives here are
|
So I'm kind of in favour of the third option where the julia type is a wrapper around the |
So it turns out that if you use Ex)
|
Rory, you need to get the For example, if you want the method |
Awesome, thanks! Sorry, I didn't put two and two together with your |
Now that Julia 0.7 has a |
I'm actually opposed to automatically converting Python's named tuple to Julia's. This is because Python's named tuples use nominal type whereas Julia's named tuples use structural type. It means that it is impossible to get the right named tuple from Python-Julia-Python round trip. |
I think it would be much better to default to returning a PyObject rather than converting the python namedtuple into a julia tuple. The python code nt = fun1()
fun2(nt) can not be replaced with the julia version nt = py.fun1()
py.fun2(nt) since the named tuple The automatic conversion appears to be destroying my object even if I do
where |
Currently the behaviour is to just convert named tuples in python to julia tuples, which obviously doesn't work if you want to pass that tuple to another python function that is expecting a named tuple.
The text was updated successfully, but these errors were encountered: