-
Notifications
You must be signed in to change notification settings - Fork 792
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
Add set binding #3
Conversation
I am not sure how to implement:
|
I think |
lgtm on implementation do you want to implement |
Switched Travis CI distribution to trusty. |
/// Creates a new set. | ||
/// | ||
/// May panic when running out of memory. | ||
pub fn new(py: Python, elements: &[PyObject]) -> PySet { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think if we change this to:
pub fn new<T: ToPythonObject>(py: Python: elements: &[T]) -> PySet {}
so that we can do:
let set = PySet::new(py, &[1, 2, 3]);
instead of
let set = PySet::new(py, &[1.to_py_object(py).into_object()]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, this is very good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But other things like PyList
still uses pub fn new(py: Python, elements: &[PyObject]) -> PyList
, I guess we should do this in a separate PR to do them all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should have write access to repo. this kind of change you can just commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll merge this then do other things.
TODO:
Ref #2
Currently this project is a little hard to get involved because of lacking development guide docs.