Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Not x.islower() has different output than x.isupper() in list output... Date: Tue, 3 May 2016 22:00:45 +1000 Lines: 22 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 X-Trace: news.uni-berlin.de TDtCmWUicVrgydhEV9lqdgGUiggHnP359oUIDwcPSpAQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'exist.': 0.09; 'implies': 0.09; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'negation': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sharp': 0.16; 'subject:Not': 0.16; 'wrote:': 0.16; 'string': 0.17; 'drawing': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'exists.': 0.22; 'suppose': 0.22; 'header:In-Reply-To:1': 0.24; 'discussion': 0.24; "doesn't": 0.26; 'subject:list': 0.26; 'chris': 0.26; 'message- id:@mail.gmail.com': 0.27; 'function': 0.28; "i'm": 0.30; 'tue,': 0.34; 'received:google.com': 0.35; 'false': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'sure': 0.39; 'real': 0.62; 'matter': 0.63; "'foo'": 0.84; 'chrisa': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=g1aEdKaO7fbMmO7L6/ikHNInASl6jR7sBKSumgcXcWA=; b=w1IamIC09O0SQJ9T5glVLj+lLzf2Uzon/GbvqgPzIsODkU10QFSes9Q2aDXPGP5z2o doL4HE4UrS9sUAB4UxHXn1tnfl5oZot/UUZiHYBLqIJQgFXCOoURw3KvPIZLoZRXOpak 6TBYoXOHpWO7F5741cWZhM/CICKLJz0b1aIFHQhW5Q6OlCTOyBlog/TYVwt2UPen51b/ kQXxwi5iAHvqBrHuUE2fnCmVPtqSJ6Fl2ziOM6OcoR6YYpoaqztn1jwHLGJjAwgDRD+o MjPv0ZS7zpAnVr0J9rY0rebGS5I10BAgfec97JILk+OO8uOkv3pUP9tslz7ldVwRhAPX IoWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=g1aEdKaO7fbMmO7L6/ikHNInASl6jR7sBKSumgcXcWA=; b=Y+bgIbSrmPgT+HSlfgR/SHJpZoykUBMapq70EnWnpwXgEppFzQdZC+eM0+fP1er1Fi AYa/HpzPj+yvMT0PVoR2BAtdXyqYFECP55T+Ikx99MFNdtHS3GM3wQFSzLvjqZD2G6zG MGMlMoubV9xeIMTp+AnX/CSwdPGUly9BkDy2BhCM/dLrHZGI+g2lgOni6N56fQYsKwnD aTfLKRrSg4kh9G1t4e72LzjoouNrO0qHHhVu455sNW4GdX+8VgE/cP7AwLLnCR7tm+Nm 64EUUapW5g7crAOZbXjdPy/eyzRA8YlrznqVkNHUXtUIx8Gh0nmPMmzwCNu63pyVgxKn E3VA== X-Gm-Message-State: AOPr4FUU3pDKYlmB2GOOuV/maUBb26Mz+eEu8jM3iSlu/U50G62ZZRa8nJ4Vv5+PoJmJrYT1oQcQqmLErO5iYg== X-Received: by 10.107.169.13 with SMTP id s13mr2604082ioe.19.1462276845793; Tue, 03 May 2016 05:00:45 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <572407AE.1070703@icloud.com> <1461979797.3824480.593944273.0B8D8DF3@webmail.messagingengine.com> <57241097.7020801@icloud.com> Xref: csiph.com comp.lang.python:108062 On Tue, May 3, 2016 at 9:25 PM, Jussi Piitulainen wrote: > Chris Angelico writes: > >> This assumes, of course, that there is a function swapcase which can >> return a string with case inverted. I'm not sure such a function >> exists. > > str.swapcase("foO") > 'FOo' I suppose for this discussion it doesn't matter if it's imperfect. >>> "\N{ANGSTROM SIGN}".swapcase().swapcase() == "\N{ANGSTROM SIGN}" False >>> "\N{LATIN SMALL LETTER SHARP S}".swapcase().swapcase() 'ss' But drawing the analogy with the negation of real numbers implies something that doesn't exist. ChrisA