
Prototype Use Case : Design Patterns In Python
Medium Article : https://medium.com/design-patterns-in-python/prototype-design-pattern-in-python-45f8d3f15583
Documentation : https://sbcode.net/python/prototype/#example-use-case
Sometimes you just want to switch off your computer and read from a book. So, all GoF patterns are discussed in my Design Patterns In Python book
https://www.amazon.com/dp/B08XLJ8Z2J : ASIN B08XLJ8Z2J
In this example, an object called document is cloned using shallow, 2 level shallow, and full recursive deep methods.
The object contains a list of two lists. Four copies are created, and each time some part of the list is changed on the clone, and depending on the method used, it can affect the original object.
When cloning an object, it is good to understand the deep versus shallow concept of copying.