Py 3.3, unicode
Py 3.3, unicode / upper()
Ian Kelly ian.g.kelly at gmail.comWed Dec 19 16:31:42 EST 2012
- Previous message (by thread): Py 3.3, unicode / upper()
- Next message (by thread): Py 3.3, unicode / upper()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Dec 19, 2012 at 2:18 PM, <wxjmfauth at 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
- Previous message (by thread): Py 3.3, unicode / upper()
- Next message (by thread): Py 3.3, unicode / upper()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list