Ian Kelly <ian.g.kelly at gmail.com> writes: >>>> sys.getsizeof(bytes(range(256)).decode('latin1')) > 329 Please try: print (type(bytes(range(256)).decode('latin1'))) to make sure that what comes back is actually a unicode string rather than a byte string.