The copy module provides shallow and deep object copying operations for lists, tuples, dictionaries, and class instances.
copy.copy()This function creates a shallow copy of the x object.
As you can see at the end of the previous example, the new list is not the old one.
As you can see, this function provides the same result that y=x[:] does. It creates a new object that references the old one. If the original object is a mutable object and has its value changed, the new object will change too.
It recursively copies the entire object. It really creates a new object without any link to the original structure.
Python Related Interview Questions
|Perl Scripting Interview Questions||C++ Interview Questions|
|PHP Interview Questions||C Interview Questions|
|Ruby on Rails Interview Questions||Ruby Interview Questions|
|Django Interview Questions||Lisp programming Interview Questions|
|R Programming language Interview Questions||wxPython Interview Questions|
|Python Automation Testing Interview Questions|
Extending And Embedding Python
Objects Interfacing And Distribution
Working With Databases
Other Advanced Topics
Basic Network Background
Python And Guis
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.