Path: csiph.com!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'example:': 0.10; 'python': 0.10; 'python.': 0.11; 'subject:python': 0.14; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.16; 'language': 0.19; 'lawrence': 0.22; 'seems': 0.23; 'header:In-Reply-To:1': 0.24; "i've": 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'least': 0.27; 'correct,': 0.29; "i'm": 0.30; 'code': 0.30; 'language.': 0.32; "d'aprano": 0.33; 'int': 0.33; 'steven': 0.33; 'worked': 0.34; 'something': 0.35; 'but': 0.36; 'too': 0.36; 'instead': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'sure': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'your': 0.60; "you'll": 0.61; 'ago.': 0.61; 'today,': 0.62; 'charset:windows-1252': 0.62; 'more': 0.63; 'our': 0.64; 'enjoy': 0.66; 'obvious': 0.76; 'like:-': 0.84; 'pythonistas,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Idiosyncratic python Date: Fri, 25 Sep 2015 00:40:11 +0100 References: <560391ea$0$2885$c3e8da3$76491128@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 195.147.66.69 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: <560391ea$0$2885$c3e8da3$76491128@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1443138046 news.xs4all.nl 23821 [2001:888:2000:d::a6]:37787 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:97104 On 24/09/2015 07:02, Steven D'Aprano wrote: > I was looking at an in-house code base today, and the author seems to have a > rather idiosyncratic approach to Python. For example: > > for k, v in mydict.items(): > del(k) > ... > > instead of the more obvious > > for v in mydict.values(): > ... > > What are your favorite not-wrong-just-weird Python moments? > My favourite was from a guy I worked with years ago. In C but I'm sure you'll enjoy it. In all functions, something like:- int flag = 0; if flag { printf("\nthe string"); } else{ printf("the string"); flag = 1; } At least I think I've got it correct, too lazy to check, sorry :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence