Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.047 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'subject:missing': 0.07; 'none)': 0.09; 'contrary,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'means:': 0.16; 'notation,': 0.16; 'subject:Language': 0.16; 'wolfgang': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'string': 0.24; 'received:74.125.82.174': 0.24; 'message-id:@mail.gmail.com': 0.29; 'pm,': 0.29; 'equivalent.': 0.30; 'sun,': 0.30; 'equivalent': 0.31; 'shorter': 0.34; 'to:addr:python-list': 0.35; 'none': 0.35; 'received:74.125.82': 0.36; 'but': 0.37; 'received:google.com': 0.37; 'received:74.125': 0.38; 'should': 0.38; 'to:addr:python.org': 0.40; 'header:Received:6': 0.61; 'maximum': 0.66; 'subject:!': 0.66; '26,': 0.73; '10:56': 0.84; 'received:10.180': 0.84; 'subject:types': 0.84 Received-SPF: pass (google.com: domain of rosuav@gmail.com designates 10.180.90.212 as permitted sender) client-ip=10.180.90.212; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rosuav@gmail.com designates 10.180.90.212 as permitted sender) smtp.mail=rosuav@gmail.com; dkim=pass header.i=rosuav@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=22Y6/iFPhFNiD22XTh6XGaNJPSEGL7FjT7W7prIq4i8=; b=QfXvPlZGANAbdAz4SFCBxuudRq5g8a57f898JdbIgp+7kQ5VryZIx5lobY70VlpJ53 2IM1mMkDsSw7VuTvEV4hcoATTSvB29MbnfJiTBzWjcG3KMHUAC9ZbXJ6XWe1KGQPee15 Ts72l9ccUvhhGcCtnkLcfBaNmG1MWML3l/BL8= MIME-Version: 1.0 In-Reply-To: <4f4a1df9$0$7609$9b4e6d93@newsspool1.arcor-online.net> References: <8c2096d9-3cc2-4b64-8f11-c1d958d94243@x19g2000yqh.googlegroups.com> <4f48996b$0$6639$9b4e6d93@newsspool2.arcor-online.net> <4f4a1df9$0$7609$9b4e6d93@newsspool1.arcor-online.net> Date: Sun, 26 Feb 2012 23:52:16 +1100 Subject: Re: PyWart: Language missing maximum constant of numeric types! From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1330260743 news.xs4all.nl 6967 [2001:888:2000:d::a6]:46933 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20893 On Sun, Feb 26, 2012 at 10:56 PM, Wolfgang Meiners wrote: > That means: > if maxlength and (len(string) <= maxlength): > > is equivalent to > if (maxlength is not None) and (len(string) <= maxlength): On the contrary, it means they are distinctly NOT equivalent. The shorter form would treat a maximum length of 0 as meaning "unlimited". Now, that's an understandable notation, but it's not what's given here; if None means unlimited, then 0 should enforce that string == "". ChrisA