.  GoF  Python, C++23, Rust  Java
 


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





.  GoF  Python, C++23, Rust  Java








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




 


     :        .     ,    1.2      ,   .




 21.   Python





21.1.   


    ,   .    ,   .     .     ,     ,      .

          .        ,  ,   .     ,   .

 Python      .     : sorted(items, key=), max(, key=), map(fn, ).  ,         .




21.2.   











Strategy   .

Concrete Strategy  .

Context     .




21.3.  :  


 01_shipping.py:










 21.1  :  










 21.1 ()  :  

.Checkout        cost.   :        .    ,          min(, key=)     order.total   .




  .


   .

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

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


