Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jussi Piitulainen Newsgroups: comp.lang.python Subject: Re: Not x.islower() has different output than x.isupper() in list output... Date: Tue, 03 May 2016 18:27:13 +0300 Organization: A noiseless patient Spider Lines: 40 Message-ID: References: <572407AE.1070703@icloud.com> <1461979797.3824480.593944273.0B8D8DF3@webmail.messagingengine.com> <57241097.7020801@icloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="19705"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bQWDZll6Ihrx6TwbJz0hdips8YPkS3/Q=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:bHrDqf0ym1xezDTydG+U7o0U3e4= sha1:7ncQXAy5e9+n+Bdb0Ms3c0xZQr8= Xref: csiph.com comp.lang.python:108076 DFS writes: > On 5/3/2016 10:49 AM, Jussi Piitulainen wrote: >> DFS writes: >> >>> On 5/3/2016 9:13 AM, Chris Angelico wrote: >> >>>> It doesn't invert, the way numeric negation does. >>> >>> What do you mean by 'case inverted'? >>> >>> It looks like it swaps the case correctly between upper and lower. >> >> There's letters that do not come in exact pairs of upper and lower case, >> so _some_ swaps are not invertible: you swap twice and end up somewhere >> else than your starting point. >> >> The "\N{ANSGTROM SIGN}" looks like the Swedish upper-case >> a-with-ring-above but isn't the same character, yet Python swaps its >> case to the actual lower-case a-with-ring above. It can't go back to >> _both_ the Angstrom sign and the actual upper case letter. >> >> (Not sure why the sign is considered a cased letter at all.) > > > Thanks for the explanation. > > Does that mean: > > lower(Å) != å ? > > and > > upper(å) != Å ? It means "\N{ANGSTROM SIGN}" != "Å", yet both lower to "å", which then uppers back to "Å" (U+00c5). The Ångström sign (U+212b) looks like this: Å. Indistinguishable from Å in the font that I'm seeing - for all I know, it's the same glyph.