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: Fri, 29 Apr 2016 18:55:35 -0700 Lines: 29 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=windows-1252; format=flowed Content-Transfer-Encoding: 8BIT X-Trace: news.uni-berlin.de qo6uUBhpaxNLTJpJ7YG0WQQM84FvtVM4fX7IlnGkyTFg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'character,': 0.07; 'situation.': 0.09; 'bug': 0.10; 'subject: \n ': 0.15; 'cased': 0.16; 'discussion:': 0.16; 'footnote': 0.16; 'lower,': 0.16; 'lowercase': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Not': 0.16; 'uppercase': 0.16; 'wrote:': 0.16; 'string': 0.17; 'stephen': 0.22; 'header:User-Agent:1': 0.26; 'subject:list': 0.26; 'chris': 0.26; 'least': 0.27; 'received:17': 0.27; 'received:10.0.0': 0.32; 'run': 0.33; 'url:python': 0.33; 'received:10.0': 0.34; 'false': 0.35; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'being': 0.37; 'thank': 0.38; 'to:addr:python.org': 0.40; 'header:MIME- version:1': 0.60; 'url:3': 0.60; 'charset:windows-1252': 0.62; 'header:In-reply-to:1': 0.84 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-29_12:,, 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-1604300030 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 In-reply-to: <1461979797.3824480.593944273.0B8D8DF3@webmail.messagingengine.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=4d515a; t=1461981335; bh=NlSuq2cEmQxDpVFQvLw64BowT62maQLJF5Xvtcrrxj0=; h=MIME-version:Content-type:Subject:To:From:Message-id:Date; b=VPSxP235Jo3ATBhhI0g1QtT8QrC5e2T5c0jiG+tJsaZRtitCNY9rPlAkziJVTbdvY vLf1PX4/KUrcFjNs9y/hD/CpY7uIkBBCOW0chCVoANipgAEJPRH/9kn2FPxf5Rxs/E YfCpqwJ77OGIewBa4HxURyZjqGvk0zJIIkxZKoUXLNxKVmyGRJpHxMJE9zNYhH05rt DfvshfZcCzOxih/GdwdqRi5VhIUn1vd3kDBBqqN6YtAC3IL8US6K2JKCzFQyKLvNzd 6X2QD2SznDAn6h0/wCt7RSO0AoJIVTv4uw7vqFZnJXMWPCJ0G9APbNZtobNiqpvFqc Sx2D/IRNoWOGg== 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: <57241097.7020801@icloud.com> X-Mailman-Original-References: <572407AE.1070703@icloud.com> <1461979797.3824480.593944273.0B8D8DF3@webmail.messagingengine.com> Xref: csiph.com comp.lang.python:107885 On 4/29/2016 6:29 PM, Stephen Hansen wrote: > If isupper/islower were perfect opposites of each-other, there'd be no > need for both. But since characters can be upper, lower, or *neither*, > you run into this situation. Based upon the official documentation, I was expecting perfect opposites. str.islower(): "Return true if all cased characters [4] in the string are lowercase and there is at least one cased character, false otherwise." https://docs.python.org/3/library/stdtypes.html?highlight=islower#str.islower str.isupper(): "Return true if all cased characters [4] in the string are uppercase and there is at least one cased character, false otherwise." https://docs.python.org/3/library/stdtypes.html?highlight=isupper#str.isupper Here's the footnote that may or not be relevant to this discussion: "[4] Cased characters are those with general category property being one of “Lu” (Letter, uppercase), “Ll” (Letter, lowercase), or “Lt” (Letter, titlecase)." A bug in the docs? Thank you, Chris R.