.  GoF  Python, C++23, Rust  Java
 


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





.  GoF  Python, C++23, Rust  Java








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




 


     :        .     ,    1.2      ,   .




 11.   Python





11.1.   


    .         , ,   ,   .           .             ,  ,       .

      :

(intrinsic)  , ,    : , ;

(extrinsic)     ,     : , .

    ,         .

Python    :     ?5  256   - ,  sys.intern    .




11.2.   











Flyweight   ,   .

Flyweight Factory    .

Client       .




11.3.  : 


 01_forest.py:










 11.1  : 










 11.1 ()  : 

.30       TreeType.    ,   30      10 000 .   ()    .      frozen=True:   -   ,   . sys.intern     :   ,   ,   .




  .


   .

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

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


