Counting bytes

Hugo Martires hmartires at cultalg.pt
Mon Feb 25 08:31:59 EST 2002


And how can i count in a list ?
It is possible ?

"Martin von Loewis" <loewis at informatik.hu-berlin.de> wrote in message
news:j4bsedlnai.fsf at informatik.hu-berlin.de...
> "Hugo Martires" <hmartires at cultalg.pt> writes:
>
> > How can i count the number of bytes of:
> > --> List []
> > --> array('d',[])
> >
> > There is any function that return's the number of bytes ?
>
> For the list, no. For the array: len(arr.tostring()) will give a rough
> estimate. The actual memory consumption is higher, due to Python and
> malloc overheads.
>
> Regards,
> Martin
>
>





More information about the Python-list mailing list