a -very- case sensitive search

Paul McGuire ptmcg at austin.rr._bogus_.com
Sun Nov 26 06:54:49 EST 2006


"John Machin" <sjmachin at lexicon.net> wrote in message 
news:1164541566.246893.279680 at l12g2000cwl.googlegroups.com...
>
John -

Thanks for the updates.  Comments below...

-- Paul

> Paul McGuire wrote:
>
>> You may have to do some setup
>> of your locale for proper handling of unicode.isupper, etc.,
>
> Whatever gave you that impression?
>

Nothing. Just my own ignorance of unicode and i18n.  This post really is 
just string mechanics and re's - I wasn't sure I had all the underlying 
unicode stuff right.

>> uppers = u"".join( unichr(i) for i in range(sys.maxunicode)
>>                     if unichr(i).isupper() )
>> lowers = u"".join( unichr(i) for i in range(sys.maxunicode)
>>                     if unichr(i).islower() )
>
> Just in case the OP is running a 32-bit unicode implementation, you
> might want to make that xrange, not range :-)
>

Good tip.  I rarely use xrange, it seems like such a language wart.  Isn't 
"range" going to become what "xrange" is in Py3k?






More information about the Python-list mailing list