-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[List Ops]: def concat(lists) possible test error #3142
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
Comments
🤖 🤖 Hi! 👋🏽 👋 Welcome to the Exercism Python Repo! Thank you for opening an issue! 🐍 🌈 ✨
◦ If you'd also like to make a PR to fix the issue, please have a quick look at the Pull Requests doc.
💛 💙 While you are here... If you decide to help out with other open issues, you have our gratitude 🙌 🙌🏽. |
The prose might benefit from some rewording but this is an intro to lists exercise. There's an explicit and specific exercise for list flattening which is distinct from this exercise. |
Hi @dfreeman500 👋🏽 Thanks for filing this issue. We pull the test cases for practice exercises from a common repo, problem specifications and use a test-case generator here on the Python track to turn the canonical data for a given exercise into python unittest/pytest test cases. Here is the canonical data for With all that being said, I agree that the word "flattened" could be easily mis-interpreted in the instructions, and could benefit from some more detail or explanation. I'd suggest that you PR a change/start a discussion about the exercise in problem specifications, and perhaps ask about the logic of the expected result for that case. I know in Python that a general default is one level of unpacking, but this is actually two levels, but not a full unpack. We may want to examine how/why that test case is there, and if it needs to be altered and/or the instructions altered. |
Closing this for now, since the issue lies in problem specifications. Can re-open if an instruction append on the track is needed. |
Hello,
I'm a relative newbie so hopefully I'm not adding more work.
In the Python List Ops project 'list_ops.py',
def concat(lists): is supposed to "(given a series of lists, combine all items in all lists into one flattened list)".
On line 36 in the test file the expected result does not appear to be a flattened list:
def test_concat_list_of_nested_lists(self): self.assertEqual( concat([[[1], [2]], [[3]], [[]], [[4, 5, 6]]]), [[1], [2], [3], [], [4, 5, 6]], )
I would expect that the test should actually be:
def test_concat_list_of_nested_lists(self): self.assertEqual( concat([[[1], [2]], [[3]], [[]], [[4, 5, 6]]]), [1, 2, 3, 4, 5, 6], )
So, [1, 2, 3, 4, 5, 6] instead of [[1], [2], [3], [], [4, 5, 6]]
Thanks for all you do!
The text was updated successfully, but these errors were encountered: