Top "Deep-copy" questions

A deep copy of an object is a separate, fully independent duplicate of that object, such that any references / pointers it holds to other objects refer to deep copies of those to which the original's refer.

Is clone() in java shallow copy?

Is clone() in java a shallow copy? Eventually this gets to the clone() method of Object (the uppermost class), which …

java deep-copy shallow-copy
How do you perform a deep copy of a struct in Go?

I'm attempting to perform a deep copy of the following struct: // Ternary Tree type Tree struct { Left *Tree Mid *Tree …

go deep-copy
copy.deepcopy vs pickle

I have a tree structure of widgets e.g. collection contains models and model contains widgets. I want to copy …

python pickle deep-copy
R, deep vs. shallow copies, pass by reference

I would like to understand the logic R uses when passing arguments to functions, creating copies of variables, etc. with …

r reference copy deep-copy data.table
Does a slicing operation give me a deep or shallow copy?

The official Python docs say that using the slicing operator and assigning in Python makes a shallow copy of the …

python list copy deep-copy
Why deepcopy of list of integers returns the same integers in memory?

I understand the differences between shallow copy and deep copy as I have learnt in class. However the following doesn't …

python python-3.x deep-copy
Is it fine to use JSON.stringify for deep comparisons and cloning?

After attempting several implementations for deep comparison and copying for JSON-serializable objects, I've noticed the fastest often are just: function …

javascript json equality deep-copy object-comparison
How can I make a deepcopy of a function in Python?

I would like to make a deepcopy of a function in Python. The copy module is not helpful, according to …

python function copy deep-copy
Shallow/deep copy of std::map

How would I best implement these? I thought of something like this: using namespace std; shape_container shape_container::clone_…

c++ deep-copy stdmap shallow-copy
TypeError: cannot deepcopy this pattern object

Trying to understand this error in my "Variable" class. I was hoping to store a sre.SRE_Pattern in my "…

python regex deep-copy