DEV Community

Discussion on: Be Careful When Copying Mutable Data Types

Collapse
 
renegadecoder94 profile image
Jeremy Grifski

Good point! Oddly enough, I wrote a whole article about cloning lists which includes slices as an example, so I'm not sure why I chose to use list comprehensions. I think the decision was based on the very last example which uses the copy constructor, but who knows! haha

Thanks again for the tip!