On Wed, Dec 19, 2012 at 2:18 PM, <wxjmfa...@gmail.com> wrote: > latin-1 (iso-8859-1) ? are you sure ?
Yes. >>>> sys.getsizeof('a') > 26 >>>> sys.getsizeof('ab') > 27 >>>> sys.getsizeof('aé') > 39 Compare to: >>> sys.getsizeof('a\u0100') 42 The reason for the difference you posted is that pure ASCII strings have a further optimization, which I glossed over and which is purely a savings in overhead: >>> sys.getsizeof('abcde') - sys.getsizeof('a') 4 >>> sys.getsizeof('ábçdê') - sys.getsizeof('á') 4 -- http://mail.python.org/mailman/listinfo/python-list