Skip to content

added list.copy() in lists.ipynb#8

Closed
manoharganta256 wants to merge 0 commit intojerry-git:masterfrom
manoharganta256:master
Closed

added list.copy() in lists.ipynb#8
manoharganta256 wants to merge 0 commit intojerry-git:masterfrom
manoharganta256:master

Conversation

@manoharganta256
Copy link
Contributor

@manoharganta256 manoharganta256 commented Oct 7, 2018

Added copy() method in lists.ipynb along with a simple example.

@jerry-git
Copy link
Owner

Thanks for the PR!

I feel that this should be under Lists are mutable section. Actually, I think list() is doing exactly the same job and I feel that it's more Pythonic (of course just my personal opinion). Thus, I would mention that there is also copy method but I wouldn't necessarily devote a new section for it.

Maybe you could mention it as an alternative under Lists are mutable. For example:

modified = list(original)  # Note list()
# Alternatively, you can use copy
# modified = original.copy()

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.

2 participants