关于python中占用内存的主要原因分析
```python
import sys
class Point:
def __init__(self,x,y,z):
self.x = x
self.y = y
self.z = z
test1 = {"x":1,"y":2,"z":3}
test2 = [1,2,3]
test3 = Point(1,2,3)
test4 = (1,2,3)
print("test1占用内存:",sys.getsizeof(test1))
print("test2占用内存:",sys.getsizeof(.
原创
2022-05-26 09:48:41 ·
1583 阅读 ·
0 评论