> > In PR#214 Martin v. Loewis suggests a sizeof function as result of > > request to python-help. I've followed the thread silently until now. > > For such basic computations of the native objects sizes, struct.calcsize > is your friend. Unfortunately, it does not work in the general case, or I'm missing something: Given >>> a={} >>> for i in range(1,10): ... a[i]=i*i ... how exactly do you find out the size occupied by a? I don't want to count the size of the keys and values themselves - just the memory used by the storage of the references to the keys and the values. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4