Py 3.3, unicode / upper()

Westley Martínez anikom15 at gmail.com
Thu Dec 20 03:53:32 CET 2012


On Wed, Dec 19, 2012 at 02:23:15PM -0700, Ian Kelly wrote:
> On Wed, Dec 19, 2012 at 1:55 PM,  <wxjmfauth at gmail.com> wrote: 
> > If "wrong", this can be considered as programmatically correct
> > or logically acceptable (Py3.2)
> >
> >>>> 'Straße'.upper().lower().capitalize() == 'Straße'
> > True
> >
> > while this will *always* be problematic (Py3.3)
> >
> >>>> 'Straße'.upper().lower().capitalize() == 'Straße'
> > False
> 
> On the other hand (Py3.2):
> 
> >>> 'Straße'.upper().isupper()
> False
> 
> vs. Py3.3:
> 
> >>> 'Straße'.upper().isupper()
> True
> 
> There is probably no one clearly correct way to handle the problem,
> but personally this contradiction bothers me more than the example
> that you posted.

Why would it ever be wrong for 'Straße' to not equal 'Strasse'?  Python
is not intended to do any sort of advanced linguistic processing.  It is
comparing strings not words.  It is not problematic.  It makes sense.



More information about the Python-list mailing list