the prototype pattern using what we have learned in our project at its heartthe prototype pattern is just clone(function that accepts an object as an input parameter and returns clone of it the skeleton of prototype pattern implementation should declare an abstract base class that specifies pure virtual clone(method any class that needs polymorphic constructor (the class decides which constructor to use based on the number of arguments it receives upon instantiationcapability derives itself from the abstract base class and implements the clone(method every unit needs to derive itself from this abstract base class the clientinstead of writing code that invokes the new operator on hard-coded class namecalls the clone(method on the prototype this is what the prototype pattern would look like in general termsprototype_ py from abc import abcmetaabstractmethod class prototype(metaclass=abcmeta)@abstractmethod def clone(self)pass concrete py from prototype_ import prototype from copy import deepcopy class concrete(prototype)def clone(self)return deepcopy(selffinallywe can implement our unit-generating building with the prototype patternusing the same prototype_ py file rts_prototype py from prototype_ import prototype from copy import deepcopy