Finding size of Variable

Ned Batchelder ned at nedbatchelder.com
Thu Feb 6 06:10:08 EST 2014


On 2/6/14 5:15 AM, wxjmfauth at gmail.com wrote:

>>>>
>>>> sum([sys.getsizeof(c) for c in ['a', 'a EURO', 'aa EURO']*3])
> 336
>>>> sum([sys.getsizeof(c) for c in ['aa EURO aa EURO']*3])
> 150
>>>> sum([sys.getsizeof(c.encode('utf-32')) for c in ['a', 'a EURO', 'aa EURO']*3])
> 261
>>>> sum([sys.getsizeof(c.encode('utf-32')) for c in ['aa EURO aa EURO']*3])
> 135
>>>>
>
> jmf
>

JMF, we've told you I-don't-know-how-many-times to stop this. 
Seriously: think hard about what your purpose is in sending these absurd 
benchmarks.  I guarantee you are not accomplishing it.

-- 
Ned Batchelder, http://nedbatchelder.com




More information about the Python-list mailing list