"monty" < "python"

jmfauth wxjmfauth at gmail.com
Sat Mar 23 10:23:21 CET 2013


On 21 mar, 04:12, rusi <rustompm... at gmail.com> wrote:
> On Mar 21, 12:40 am, jmfauth <wxjmfa... at gmail.com> wrote:
>
> > ----
>
> > Courageous people can try to do something with the unicode
> > collation algorithm (see unicode.org). Some time ago, for the fun,
> > I wrote something (not perfect) with a reduced keys table (see
> > unicode.org), only a keys subset for some scripts hold in memory.
>
> > It works with Py32 and Py33. In an attempt to just see the
> > performance and how it "can react", I did an horrible mistake,
> > I forgot Py33 is now optimized for ascii user, it is no more
> > unicode compliant and I stupidely tested/sorted lists of French
> > words...
>
> Now lets take this piece by piece…
> "I did an horrible mistake" : I am sorry. Did you get bruised? Break
> some bones? And is 'h' a vowel in french?
> "I forgot Py33 is now optimized for ascii user"  Ok.
> "it is no more unicode compliant" I asked earlier and I ask again --
> What do you mean by (non)compliant?

------

One aspect of Unicode (note the capitalized "U").

py32
>>> timeit.repeat("'abc需'.find('a')")
[0.27941279564856814, 0.26568106110789813, 0.265546366757917]
>>> timeit.repeat("'abcdef'.find('a')")
[0.2891812867801491, 0.26698153112010914, 0.26738994644529157]

py33
timeit.repeat("'abc需'.find('a')")
[0.5941777382531654, 0.5829193385634426, 0.5519412133990045]
timeit.repeat("'abcdef'.find('a')")
[0.44333188136533863, 0.4232506078969891, 0.4225164843046514]


---

In French, depending of the word, a leading "h", behaves
as a vowel or as a consonant.
(From this -> this typical mistake)

jmf






More information about the Python-list mailing list