Unicode 7
wxjmfauth at gmail.com
wxjmfauth at gmail.com
Tue Apr 29 13:37:38 EDT 2014
Let see how Python is ready for the next Unicode version
(Unicode 7.0.0.Beta).
>>> timeit.repeat("(x*1000 + y)[:-1]", setup="x = 'abc'; y = 'z'")
[1.4027834829454946, 1.38714224331963, 1.3822586635296261]
>>> timeit.repeat("(x*1000 + y)[:-1]", setup="x = 'abc'; y = '\u0fce'")
[5.462776291480395, 5.4479432055423445, 5.447874284053398]
>>>
>>>
>>> # more interesting
>>> timeit.repeat("(x*1000 + y)[:-1]",\
... setup="x = 'abc'.encode('utf-8'); y = '\u0fce'.encode('utf-8')")
[1.3496489533188765, 1.328654286266783, 1.3300913977710707]
>>>
Note 1: "lookup" is not the problem.
Note 2: From Unicode.org : "[...] We strongly encourage [...] and test
them with their programs [...]"
-> Done.
jmf
More information about the Python-list
mailing list