一般没有特指,参考的是Python 2.7.2的源码。在intobject.h的开头就有英文注释,对PyIntObject进行了一下简单介绍。原文如下:/*PyIntObject represents a(long)integer.This is an immutable object;an integer cannot change its value ...
当然,Python也提供了intern()内置函数来缓存用户想要的字符串对象。缓存hash值以及intern机制为解释器加速了20%。最后,是关于字符串的连接。比如:str=str1+str2+str3+str4,由于PyStringObject is immutable,所以会为3个+号执行3次内存...