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

Restore support for &Class and &mut Class as arguments #786

Closed
davidhewitt opened this issue Mar 3, 2020 · 1 comment · Fixed by #791
Closed

Restore support for &Class and &mut Class as arguments #786

davidhewitt opened this issue Mar 3, 2020 · 1 comment · Fixed by #791
Assignees
Milestone

Comments

@davidhewitt
Copy link
Member

We can't implement FromPyObject for them. You can use PyRef and PyRefMut as arguments.

Agreed we can't implement FromPyObject for them. It would be nice if we can find another way for the generated wrappers to support &Class and &mut Class arguments - by calling .try_borrow() in the wrapper, perhaps, like we can do for &self.

Originally posted by @davidhewitt in #785 (comment)

@kngwyu
Copy link
Member

kngwyu commented Mar 3, 2020

I'm experimenting an idea to change our generated method call(_slf.#fname(#name1, #name2, ...) to _slf.#fname(&*#name1, &*#name2, ...) only when an arg(e.g., #name1) is reference type.
Though I'm not sure it's possible 🤔

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

Successfully merging a pull request may close this issue.

2 participants