Skip to content

Update _mut_iter_equal_skeleton method #3968

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

Merged
merged 2 commits into from
Aug 7, 2022

Conversation

Karatuss
Copy link
Contributor

This code is tested based on list_tests.py::CommonTest::test_remove,
except for lines 352~358 that seem related to str test.

@youknowone
Copy link
Member

line 352 is not related to string. try to print its type like print(type(self.type2test)) that's list type. e.g. list.
list('abcdefghcij') is ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'c', 'i', 'j']

@youknowone
Copy link
Member

By watching CI, it is causing dead-lock. it didn't finish during 4 hours.

@youknowone youknowone added the z-ca-2022 Tag to track contrubution-academy 2022 label Jul 27, 2022
@Karatuss
Copy link
Contributor Author

Now, two list method index, remove works normally by fixing _mut_iter_equal_skeleton method.

@Snowapril
Copy link
Contributor

Snowapril commented Jul 27, 2022

Nice catch! The changed codes seem totally fine to me. Please check unexpected success in test_list, test_deque tests 😊

@youknowone youknowone requested a review from qingshi163 July 27, 2022 22:14
Copy link
Contributor

@fanninpm fanninpm left a comment

Choose a reason for hiding this comment

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

Please don't leave these things behind in the code. They're not there in CPython.

@fanninpm fanninpm self-requested a review July 29, 2022 12:26
@fanninpm fanninpm dismissed their stale review July 29, 2022 12:27

beat me to it

Copy link
Contributor

@fanninpm fanninpm left a comment

Choose a reason for hiding this comment

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

LGTM.

@youknowone
Copy link
Member

@qingshi163 could you review this PR?

@qingshi163
Copy link
Contributor

As I remember, the guard or borrower is to optimize the compare by check if the class is not the heap type, so we can reuse the compare function in each loop. Also to use rich_compare_bool we cannot reuse the PyTypeRef for the compared object but this will be no more the issue if we can fetch the PyType atomicly in the future.

Yes, the correctness is more important than performance, but if you can solve the problem without drawback the performance could be amazing. if not please advise the issue or the failing point of the current implement, so we could see why this is not going to work.

@youknowone

Thanks

Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

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

@qingshi163 I created an issue to refer this pr #4008
@TwoPair Thank you!

@youknowone youknowone merged commit 33db28d into RustPython:main Aug 7, 2022
@Karatuss Karatuss deleted the list-remove branch August 9, 2022 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
z-ca-2022 Tag to track contrubution-academy 2022
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants