Ans: Shallow copy stores the values that are copied in the new instance. It copies the reference pointers as well as the values. These references indicate the original objects. That’s why, if any changes are made to any member of the class, the original copy will be affected. Depending on the size of the data, it helps in faster execution.
Deep copy stores the values that are copied already. In addition to that, it doesn’t copy the reference pointers. If the original copy is altered, it won’t affect any other copy with the objects. It slows down the execution as multiple copies of the object are stored.
Ans: Python offers a package for multi-threading. However, for those who want to multi-thread to make your code run faster, then use it is not really a great idea.
Ans: Basically, because of compiling and linking new extensions can be compiled without an error. After the compiling process is done, linking can take place.
Ans: Originally, Flask is a microframework. The purpose of Flask was to help with the small applications that have simple needs. It is ready to use and helps the programmer to use external libraries.
In contrast to Flask, Pyramid is created for bigger applications. It ensures flexibility so that the developer gets to use the correct tools according to the nature of their work. The developer has the liberty to opt for the database, URL structure, templating style, etc. we can say that Pyramid is heavily configurable.
Similarly, Django is used for larger applications. On top of that, it has an ORM.
Ans: As the name suggests, Multi-line comments are present in multiple lines. Each and every line that is commented must be prefixed by a #. Most importantly, there is a method that does this directly in less time. If you are looking for a shortcut method to comment in multiple lines, hold the ctrl key and left-click in the spots where you want to add a # character. Finally, type a # only once. You can comment on all the lines wherever you clicked the cursor with this method.
|