MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/28utww/writing_better_python_code/ciexcbt/?context=3
r/Python • u/kracekumar • Jun 23 '14
126 comments sorted by
View all comments
7
Is foo[:] really the Pythonic way to copy a list?
foo[:]
Edit: In Python 3, lists have their own .copy() method.
.copy()
3 u/toyg Jun 23 '14 There's also copy.copy().
3
There's also copy.copy().
7
u/oconnor663 Jun 23 '14 edited Jun 23 '14
Is
foo[:]really the Pythonic way to copy a list?Edit: In Python 3, lists have their own
.copy()method.