Re: io.BytesIO

2013-03-25 Thread Fabian von Romberg
>> actually why I need is to know how much memory has been allocated for >> buffering. >> >> getsizeof gets the size of the object structure. > > I can see at least four ways to get the current size of the BytesIO > buffer: > > py> obj = io.BytesIO(

Re: io.BytesIO

2013-03-24 Thread Steven D'Aprano
f the BytesIO buffer: py> obj = io.BytesIO(b"x"*12468) py> obj.getbuffer().nbytes 12468 py> len(obj.getvalue()) 12468 py> len(obj.getbuffer()) 12468 py> obj.seek(0, 2) 12468 As far as I can tell, BytesIO objects do not have a fixed size buffer. They will increase in si

Re: io.BytesIO

2013-03-24 Thread Fabian von Romberg
attribute or method? Regards, Fabian On 03/24/2013 11:47 PM, Steven D'Aprano wrote: > 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 a

Re: io.BytesIO

2013-03-24 Thread Steven D'Aprano
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 a

io.BytesIO

2013-03-24 Thread Fabian von Romberg
Hi, is there any way to get the allocated memory size from a io.BytesIO object? Thanks and regards, Fabian -- http://mail.python.org/mailman/listinfo/python-list