GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-94808: add tests covering `PySequence_[InPlace]Concat` by sobolevn · Pull Request #99319 · python/cpython Conversation
|
|
There's an unrelated test failure:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
cc @gvanrossum |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Let's first have a discussion about the appearance and intentions of these tests here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| self.assertEqual(operator.concat(data1, data2), | ||
| ListSubclass([1, 2, 'a', 'b'])) | ||
| self.assertEqual(operator.concat(data1, data2), data1 + data2) | ||
| self.assertEqual(data1, ListSubclass([1, 2])) # must not change | ||
| self.assertEqual(data2, ListSubclass(['a', 'b'])) # must not change |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This doesn't prove much. The results are in all cases list instances, not ListSubclass instances, because of the way list operator overloading works -- data1+data2 is a plain list, and __eq__ considers a plain list equal to a list subclass with the same elements. The test makes it appear differently.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks! I've totally missed that. I've added several assertIsInstance checks and updated the expected values.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I still have some quibbles.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| TupleSubclass(['a', 'b', 1, 2])) | ||
| self.assertEqual(operator.concat(data1, data2), data1 + data2) | ||
| res = operator.concat(data1, data2) | ||
| self.assertIsInstance(res, TupleSubclass) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This one is good.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, it took me quite longer than I expected to get back to it :) I've addressed your main review points. I went with very defensive asserts in this case. So, I've made several changes to this PR:
So, I hope it should be good now! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @kumaraditya303, @gvanrossum: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Please find another reviewer, I'm on vacation. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Happy vacation 🏖️ 😊 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Reopening. This was prematurely closed because the meta issue was misidentified as a simple issue. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Muse Code (Meta Muse Spark) # Conflicts: # Lib/test/test_operator.py
The PR added a second test_concat to OperatorTestCase, silently shadowing the existing one and failing ruff F811. Give the new, subclass-focused test its own name. Co-authored-by: Muse Code (Meta Muse Spark)
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.