Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Reimer Newsgroups: comp.lang.python Subject: Re: Not x.islower() has different output than x.isupper() in list output... Date: Sat, 30 Apr 2016 10:36:19 -0700 Lines: 16 Message-ID: References: <572407AE.1070703@icloud.com> <1461979797.3824480.593944273.0B8D8DF3@webmail.messagingengine.com> <57241097.7020801@icloud.com> <1461998604.3888861.594056577.710E696D@webmail.messagingengine.com> <5724E1CF.9060905@icloud.com> <1462036309.4005755.594329209.1106AF27@webmail.messagingengine.com> <5724ED13.9070606@icloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de C7kWO+7MsJ3Mltz/WJcBQQiOzpHU4JYMjdNxTSomFIOA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'string.': 0.04; 'test,': 0.05; 'false.': 0.07; 'run,': 0.07; 'subject: \n ': 0.15; 'cased': 0.16; 'lowercase': 0.16; 'parts.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Not': 0.16; 'wrote:': 0.16; 'stephen': 0.22; 'am,': 0.23; 'tried': 0.24; 'header:User- Agent:1': 0.26; 'subject:list': 0.26; 'chris': 0.26; 'not.': 0.27; 'least': 0.27; 'received:17': 0.27; 'went': 0.28; 'character.': 0.29; 'lies': 0.29; 'received:10.0.0': 0.32; 'maybe': 0.33; 'getting': 0.33; 'problem': 0.33; 'received:10.0': 0.34; 'but': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'operating': 0.37; 'thank': 0.38; 'to:addr:python.org': 0.40; 'where': 0.40; 'header:MIME- version:1': 0.60; 'relationship': 0.61; 'charset:windows-1252': 0.62; 'different': 0.63; 'between': 0.65; '10:11': 0.84; 'header :In-reply-to:1': 0.84 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-30_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1604300285 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 In-reply-to: <1462036309.4005755.594329209.1106AF27@webmail.messagingengine.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=4d515a; t=1462037778; bh=09ib+Kvkp1BZxIMiF8bsr0hXo6Tma+IMiM/momngdTE=; h=Subject:To:From:Message-id:Date:MIME-version:Content-type; b=JDp1Rm0VXB9Vx5sPfFYoEfypBloL4wFJjzeNsrECs2Ukw05L8XwkGpM7GzUILeYWo +FqtSsdFw0OvI4EgJoRmMqh0HKyg5XGiWlwWAkhRvKhM7xUpL0pFOBH2TzUPZTJ5mW jwxMIbjn3taEGqa2ZSKYLPU/FjX52/lFXqVJX/wcp9kyB7UnQs+t5gUsd3U6I10okq TWhyeth2Mf5z4WxweTYk4Pw5A5idRk93KDuHh2wEwsyEsgDJqv4o87dnqy020d6jWG /WTEvxpdeSr9JR8CBfOR2Z/ifdstaV47HqBFbYrFnklK2XU5DCFYCH1mDpItsBJB+7 YhEnryBn5TKIQ== 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: <5724ED13.9070606@icloud.com> X-Mailman-Original-References: <572407AE.1070703@icloud.com> <1461979797.3824480.593944273.0B8D8DF3@webmail.messagingengine.com> <57241097.7020801@icloud.com> <1461998604.3888861.594056577.710E696D@webmail.messagingengine.com> <5724E1CF.9060905@icloud.com> <1462036309.4005755.594329209.1106AF27@webmail.messagingengine.com> Xref: csiph.com comp.lang.python:107919 On 4/30/2016 10:11 AM, Stephen Hansen wrote: > You're thinking of the whole "string", but you're operating on > single-character substrings, and when " ".islower() is run, its false. > Because the two-pronged test, a) if all cased characters are lowercase > and b) there is at least one cased character. b) is failing. Ergo, > you're getting the underscores. I see where the problem lies in my thinking. I went looking for a single line solution for the whole string. If I had constructed a for loop and tried to reduce it to a single line, I *may* have understood the relationship between the different parts. Or maybe not. Blaming the documentation is a lot easier. ;) Thank you, Chris R.