.  GoF  Python, C++23, Rust  Java
 


        .         ,           .  GoF    Python, C++23, Rust  Java.     ,  , ,     .





.  GoF  Python, C++23, Rust  Java








       (Prototype).       (Gang of Four, GoF).       :  Python, C++23, Rust  Java.      :     ,  , ,     .




 


     :        .     ,    1.2      ,   .




 4.   Python





4.1.   


      ,    .      , ,        .           .         :      .

   :    ,       .  Python        copy   copy.copy ( )  copy.deepcopy (),   dataclass  dataclasses.replace.      Python    ,    :     .




4.2.   











Prototype  .

ConcretePrototype ,   .

Client  ,  .

Registry    .




4.3.    


     Python,    .

 01_shallow_deep.py:










 4.1    

.copy.copy   ,        ,    .  hp ,  shallow.hp -= 30           .   loot :      . copy.deepcopy    ,     .

:        (, ,  ),    ,          .




4.4.  :  clone


  ,      :    ,   ,   .      clone    __copy__  __deepcopy__.

 02_clone.py:










 4.2  :  clone










 4.2 ()  :  clone

. clone         : copy.copy(self)        ,  r, w  h,      .         .      . ,   moved,   ,     .




  .


   .

   ,     (https://www.litres.ru/book/aleksey-primak/prototip-pattern-gof-na-python-c-23-rust-i-java-74810764/)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


