Message68922
| Author |
pitrou |
| Recipients |
gvanrossum, humitos, pitrou, sven.siegmund |
| Date |
2008年06月28日.22:35:38 |
| SpamBayes Score |
0.034587175 |
| Marked as misclassified |
No |
| Message-id |
<1214692537.6074.29.camel@fsol> |
| In-reply-to |
<1214691600.46.0.810070981521.issue2834@psf.upfronthosting.co.za> |
| Content |
Le samedi 28 juin 2008 à 22:20 +0000, Guido van Rossum a écrit :
> Finally, is there a use case of re.LOCALE any more? I'm thinking not.
It's used for locale-specific case matching in the non-unicode case. But
it looks to me like a bad practice and we could probably remove it.
'C'
>>> re.match('À'.encode('latin1'), 'à'.encode('latin1'), re.IGNORECASE)
>>> re.match('À'.encode('latin1'), 'à'.encode('latin1'), re.IGNORECASE |re.LOCALE)
>>> locale.setlocale(locale.LC_CTYPE, 'fr_FR.ISO-8859-1')
'fr_FR.ISO-8859-1'
>>> re.match('À'.encode('latin1'), 'à'.encode('latin1'), re.IGNORECASE)
>>> re.match('À'.encode('latin1'), 'à'.encode('latin1'), re.IGNORECASE | re.LOCALE)
<_sre.SRE_Match object at 0xb7b9ac28> |
|