-
Notifications
You must be signed in to change notification settings - Fork 779
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
do we need NoArgs? #36
Comments
If we add a impl<T: IntoPyTuple> IntoPyTuple for Option<T> {
fn into_tuple(self, py: Python) -> Py<PyTuple> {
match self {
Some(v) => v.into_tuple(py),
None => PyTuple::empty(py)
}
}
} We can use |
Super! Let's do that |
Unfortunately
|
What if you use NoArgs as |
Ah, nevermind |
is it possible to use default generic type parameter? |
I am not sure what you mean by |
default generic type parameter seems only allowed in type declaration now.
|
If we change fn call<A>(&self, args: A, kwargs: Option<&PyDict>) -> PyResult<&PyObjectRef>
where A: Into<Option<Py<PyTuple>>> Use should be able to pass impl<T> From<T> for Option<T> https://doc.rust-lang.org/src/core/option.rs.html#854-858 But that would require user to provide a |
I think it would reduce usability. i use |
we can play with associated types, similar to class protocols. but I am not sure if it could be implemented |
lets close this issue, |
it is possible to use
()
instead ofNoArgs
The text was updated successfully, but these errors were encountered: