io.BytesIO

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Mar 25 05:47:15 CET 2013


On Sun, 24 Mar 2013 22:56:12 -0500, Fabian von Romberg wrote:

> Hi,
> 
> is there any way to get the allocated memory size from a io.BytesIO
> object?

The same as for any object:

py> import io, sys
py> obj = io.BytesIO()
py> sys.getsizeof(obj)
48


Is this what you are after, the size of the object itself, including any 
overhead?


-- 
Steven



More information about the Python-list mailing list