Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.046 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'subject:query': 0.07; 'cc:addr:python-list': 0.11; 'assignments.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'normal,': 0.16; 'student': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'cc:addr:python.org': 0.22; 'certainly': 0.24; 'subject:Code': 0.24; 'cc:2**0': 0.24; 'subject:/': 0.26; 'header :In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'maybe': 0.34; 'received:google.com': 0.35; 'picking': 0.36; 'shorter': 0.36; 'teaching': 0.64; 'more': 0.64; 'power': 0.76; 'choose.': 0.84; 'heh.': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=nTnC72F301t2Qs60SqkaqKR+GcpPjP+fKrF6/EcEJYw=; b=sIFM16uA1d6baV+DxR2h8KpqXACr7rx1RDZmPCU/B8VgknmAZV1rH9mtO0cVqvbtkh 8b2ZRne8kJ8whPbP3JTPeTLUntC/Na4l7wHzURP/ibXO8nSAhTI1Qj82ElDiMgjjUeZn mGFzreMZympk85IKa2xTlHywfyJs9ZXYTVC9ZdOxeI8hcmpZLzxtGaozQE1a3LtvRv3x T7C/3W+vTTf+ldnmncGJTeLcbk77vpePF4driDXhqHJIJWHiqvPUTqWsnt47NoTbGWur PDtchovesWKgnsObfsNQwdhi/JOVcI9UXjrQeBaoxOs2V7Qm5CJEGenkquwMujL2f0jD Fl/Q== MIME-Version: 1.0 X-Received: by 10.68.197.36 with SMTP id ir4mr26236413pbc.46.1396283394582; Mon, 31 Mar 2014 09:29:54 -0700 (PDT) In-Reply-To: <6775d115-a592-4082-a427-5789e1dd2875@googlegroups.com> References: <874n2ecr5x.fsf@elektro.pacujo.net> <6775d115-a592-4082-a427-5789e1dd2875@googlegroups.com> Date: Tue, 1 Apr 2014 03:29:54 +1100 Subject: Re: Code style query: multiple assignments in if/elif tree From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396283403 news.xs4all.nl 2951 [2001:888:2000:d::a6]:37744 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69436 On Tue, Apr 1, 2014 at 3:20 AM, Rustom Mody wrote: > On the whole I prefer multiple assignments. > Maybe in this case use small variable names with > separate(d) explanatory comments?? Shorter variable names would certainly be the more normal, heh. I let my brother do that part of the typing, picking names and so on. Better for teaching to let the victi-- err, the student have the power to choose. :) ChrisA