Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (12.7k points)
I might want to make a duplicate of an object. I need the new item to have all properties of the old object (estimations of the fields). Be that as it may, I need to have independent objects. In this way, in the event that I change estimations of the fields of the new object, the old object ought not be influenced by that.

1 Answer

0 votes
by (26.4k points)

To get a completely autonomous duplicate of an object you can utilize the copy.deepcopy() function. 

For additional insights regarding shallow and deep copying please refer to different responses to this inquiry and the decent clarification in this response to a connected inquiry.

Wanna become a Python expert? Come and join the python certification course and get certified.

Related questions

0 votes
1 answer
asked Jul 2, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
asked Jul 9, 2019 in Java by Nigam (4k points)
0 votes
2 answers
asked Aug 23, 2019 in Python by Sammy (47.6k points)
+1 vote
3 answers
asked May 21, 2019 in Python by Shivangi (13.2k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...