Python-- buffer

Original: Department of Bo main article original article, reproduced and quoted, please indicate the source.

 

1. In Python, strings and integer objects are immutable ( the immutable) types, Python will cache them very efficiently.

 

2. Python2.3 simple integers buffer range (1,100), after at least Python2.5.4 range is simple integers cache (-5,256). All short characters (including single character) are also in the buffer zone.

 

3. tuple (tuple) is immutable, the tuple is not supported by a single cache.

 

[References]

  1. https://www.cnblogs.com/Presley-lpc/p/9129643.html
  2. https://blog.csdn.net/pro_leo/article/details/41786397

 

Guess you like

Origin www.cnblogs.com/oddcat/p/11224501.html