python 内存管理

前端之家收集整理的这篇文章主要介绍了python 内存管理前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  • 小整数缓存池
a = 1
b = 1
print(a is b) # True
  • 短字符串
 
# True
a = "good"
b = "good"
print(a is b)

# False
a = "very good morning"
b = "very good morning"
print(a is b)

# False
a = []
b = []
print(a is b)
本文首发于python黑洞网博客园同步更新

 

原文链接:https://www.f2er.com/pythoninterview/997924.html

猜你在找的Python面试题相关文章