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

pybinding - vector<int> returned by value, how to return by reference? #241

Open
eacousineau opened this issue Jul 24, 2013 · 0 comments
Open

Comments

@eacousineau
Copy link

Hello,

I've written a basic ecto cell: https://github.com/eacousineau/ecto_simple
I have it update the cell's input 'vector', which is a vector. However, whenever I call the 'inputs.vector', it always returns a new instance of ecto.VectorInt (in the repr(), you can see the address changing):

In [4]: test.inputs.vector
Out[4]: <ecto.ecto_main.VectorInt at 0x2338d50>

In [5]: test.inputs.vector
Out[5]: <ecto.ecto_main.VectorInt at 0x2338e50>

In [6]: test.inputs.vector
Out[6]: <ecto.ecto_main.VectorInt at 0x2338dd0>

In [7]: test.inputs.vector
Out[7]: <ecto.ecto_main.VectorInt at 0x2409950>

I can solve this by creating an instance of VectorInt (seen here), but is there a more elegant solution for this?
Is there a way to have the tendril pass the vector by reference instead?

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