On Thu, 10 Jan 2008 00:14:42 -0800, Santiago Romero wrote:
>> Would you care to precisely define "REAL size" first? Consider:
>>
>> >>> atuple = (1, 2)
>> >>> mylist = [(0, 0), atuple]
>>
>> Should sizeof(mylist) include sizeof(atuple) ?
>
> No, I'm talking about "simple" lists, without REFEREN
Hi,
The only list without references to other objects in it is [ ].
0, 1, 2, etc are objects. Every value in Python is a reference to an object.
Remco
On Jan 10, 2008 9:14 AM, Santiago Romero < [EMAIL PROTECTED]> wrote:
>
> > Would you care to precisely define "REAL size" first? Consider:
> >
> Would you care to precisely define "REAL size" first? Consider:
>
> >>> atuple = (1, 2)
> >>> mylist = [(0, 0), atuple]
>
> Should sizeof(mylist) include sizeof(atuple) ?
No, I'm talking about "simple" lists, without REFERENCES to another
objects into it.
I mean:
lists = [ 0, 1, 2, 3, 4, (1
Sion Arrowsmith wrote:
> Santiago Romero <[EMAIL PROTECTED]> wrote:
>> Is there a way to check the REAL size in memory of a python object?
>>
>> Something like
>>
>>> print sizeof(mylist)
>> [ ... ]
>
> Would you care to precisely define "REAL size" first? Consider:
>
atuple = (1, 2)
Santiago Romero <[EMAIL PROTECTED]> wrote:
> Is there a way to check the REAL size in memory of a python object?
>
> Something like
>
>> print sizeof(mylist)
> [ ... ]
Would you care to precisely define "REAL size" first? Consider:
>>> atuple = (1, 2)
>>> mylist = [(0, 0), atuple]
Should sizeo
Santiago Romero wrote:
> Is there a way to check the REAL size in memory of a python object?
in standard Python, without reading the interpreter source code
carefully, no.
to get an approximate value, create a thousand (or a million) objects
and check how much the interpreter grows when you d
Is there a way to check the REAL size in memory of a python object?
Something like
> print sizeof(mylist)
or
> print sizeof(myclass_object)
or something like that ...
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list