Skip to content
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

Update 04-lists.md #763

Open
wants to merge 2 commits into
base: gh-pages
from

Conversation

@AnnAnnFryingPan
Copy link

AnnAnnFryingPan commented Nov 26, 2019

I think it's good to repeat the explanation of the behaviour caused by the (attempted) copying and then modifying of a list in place. From teaching this several times, I think it would be useful to notify the learner that the use of append here to modify a 'copied' list is a second, similar example to what we saw earlier with the salsa list.

I think it's good to repeat the explanation of behaviour caused by (attempted) copying and then modifying the list in place. From teaching this several times, I think it would help to notify the learner that the use of append here is a second, similar example to what we saw earlier with the salsa list.
@ldko

This comment has been minimized.

Copy link
Contributor

ldko commented Dec 2, 2019

Thanks @AnnAnnFryingPan , I see what you mean about making it clear that this is a second example of "copying" a list and what can happen. Your proposed change is a valid solution and like you say, it is beneficial to repeat the point about modifying a list in place. I wonder though, with the lesson being overly full, what others think about removing one of the explanations of using list() (I would lean toward removing the salsa example). @annefou @maxim-belkin ?

If we want to keep both examples, I think your wording changes are good to include with the minor edit of adding back a comma before the clause we can cause all sorts of trouble.

@annefou

This comment has been minimized.

Copy link
Contributor

annefou commented Dec 2, 2019

What I find a bit confusing is the fact that we have "Nested lists" and "Heterogeneous lists" between these two examples. So as you said @AnnAnnFryingPan it is then a good idea to remind learners that we are repeating what we said with another example. To make the episode a bit shorter, we could have at least "Nested lists" as complementary material. I usually skip it when teaching this part.

@@ -268,7 +268,7 @@ odds after reversing: [11, 7, 5, 3]
While modifying in place, it is useful to remember that Python treats lists in a slightly
counter-intuitive way.

If we make a list and (attempt to) copy it then modify in place, we can cause all sorts of trouble:
As we saw earlier, when we modified the (salsa) list item in-place, if we make a list, (attempt to) copy it and then modify this list we can cause all sorts of trouble. This also applies to modifying the list using the above functions:

This comment has been minimized.

Copy link
@ldko

ldko Dec 13, 2019

Contributor

@AnnAnnFryingPan , after discussing with the other maintainers, we would like to incorporate your suggestion to refer back to the earlier time in the episode where modifying in-place is covered. Before we do so, would you mind changing (salsa) to `salsa` (in back ticks instead of parentheses) , and add a comma back in before we can cause all sorts of trouble? Thank you for your contribution!

This comment has been minimized.

Copy link
@AnnAnnFryingPan

AnnAnnFryingPan Dec 14, 2019

Author

@IDKo, Thanks, I have done the requested updates.

Replaced brackets with back-ticks and added comma.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.