Skip to content

Conversation

@palaviv
Copy link
Contributor

@palaviv palaviv commented Mar 31, 2019

Same as #765 but for tuple and list.

@codecov-io
Copy link

Codecov Report

Merging #770 into master will increase coverage by 0.13%.
The diff coverage is 66.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #770      +/-   ##
==========================================
+ Coverage   62.04%   62.17%   +0.13%     
==========================================
  Files          80       80              
  Lines       12722    12643      -79     
  Branches     2620     2596      -24     
==========================================
- Hits         7893     7861      -32     
+ Misses       3159     3122      -37     
+ Partials     1670     1660      -10
Impacted Files Coverage Δ
vm/src/obj/objsequence.rs 57.55% <63.55%> (+3.05%) ⬆️
vm/src/obj/objlist.rs 75.23% <80%> (+3.66%) ⬆️
vm/src/obj/objtuple.rs 67.77% <81.81%> (+11.13%) ⬆️
vm/src/pyobject.rs 76.33% <0%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aede03c...67518c6. Read the comment docs.

where
Self: Sized,
{
fn get_elements(&self) -> Vec<PyObjectRef>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we definitely don't want to copy the entire vec just to eg check its size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I can't do a Deref inside the trait. Do you have a suggestion for something nicer then returning the Refcell?

Copy link
Member

@coolreader18 coolreader18 Mar 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could try returning an &[PyObjectRef], or if that wouldn't work an impl Deref<Target = [PyObjectRef]>.

{
fn get_elements(&self) -> Vec<PyObjectRef>;
fn as_object(&self) -> &PyObjectRef;
fn into_object(self) -> PyObjectRef;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be split off into a separate trait, and we could have a generic impl<T> ... for PyRef<T>

@palaviv
Copy link
Contributor Author

palaviv commented Apr 8, 2019

Should be implemented with inner like #785.

@palaviv palaviv closed this Apr 8, 2019
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 this pull request may close these issues.

4 participants