Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'binary': 0.05; 'context': 0.05; 'subject:code': 0.07; 'python': 0.09; 'check.': 0.09; 'symbols': 0.09; 'def': 0.10; '*a*': 0.16; 'associated.': 0.16; 'personally,': 0.16; 'received:192.168.1.50': 0.16; 'ternary': 0.16; 'wrote:': 0.17; 'odd': 0.17; 'programming': 0.23; 'feature': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'language.': 0.27; 'probably': 0.29; "skip:' 10": 0.30; 'usually': 0.30; 'performing': 0.30; 'to:addr:python-list': 0.33; 'pm,': 0.35; 'something': 0.35; 'but': 0.36; 'uses': 0.37; 'being': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'received:62': 0.62; 'thomas': 0.62; 'skip:n 10': 0.63; 'confusing': 0.84; 'from:addr:t': 0.84; 'otten': 0.84; 'received:62.75': 0.84; 'spell': 0.91 Date: Sat, 30 Jun 2012 21:38:58 +0200 From: Thomas Jollans User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: code review References: <6c39594f-79cb-4d4f-967e-bbc3f68cdbdf@f8g2000pbf.googlegroups.com> <4fed59b7$0$29978$c3e8da3$5496439d@news.astraweb.com> <2662370.TGmo96CKe1@PointedEars.de> In-Reply-To: <2662370.TGmo96CKe1@PointedEars.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341085147 news.xs4all.nl 6874 [2001:888:2000:d::a6]:50993 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24699 On 06/30/2012 08:39 PM, Thomas 'PointedEars' Lahn wrote: > Peter Otten wrote: > >> If you spell it >> >> def is_valid_password(password): >> return mud.minpass <= len(password) <= mud.maxpass >> >> it is even easier to see that you are performing an interval check. > > This is probably a tautology around here, but *what* *a* *great* > *programming* *language*. > Personally, I don't like this feature of the language. I find a ternary operator that uses symbols that can also be binary operators confusing and inconsistent with the way operators usually work/the way terms are usually associated. It has the charm of being something you'd "naturally" write in the context of non-programming mathematics, at the cost of being very odd indeed in the context of programming in general and Python in particular.