Le mercredi 17 octobre 2012 20:28:21 UTC+2, Ian a écrit : > On Wed, Oct 17, 2012 at 12:17 PM, <wxjmfa...@gmail.com> wrote: > > > Not at all, I knew this. In this I decided to program like > > > this. > > > > > > Do you get it? Yes/No or True/False > > > > It's just bad style, because both 'yes' and 'no' evaluate true. > > > > if HasDiacritics('éléphant'): > > print('Correct!') > > > > if HasDiacritics('elephant'): > > print('Error!') > > > > Prints: > > > > Correct! > > Error! > > > > You could replace the test with "if HasDiacritics('elephant') == > > 'yes':", but why force the caller to write that out when the former > > test is more natural and less prone to error (e.g. typoing 'yes')?
I *know* all this. In my prev. msg, the goal was to emph. the usage of *unicode.normalize()". jmf -- http://mail.python.org/mailman/listinfo/python-list