Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: pylint woes Date: Sun, 8 May 2016 14:21:49 +1000 Lines: 35 Message-ID: References: <572eb1c3$0$1616$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de dKjjm6E8nvZXknMpze5ndg4XnjhCqvXmQRt3QXtwD9KQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'lines.': 0.07; 'newline': 0.07; 'cc:addr:python-list': 0.09; '"if': 0.09; '__future__': 0.09; 'python': 0.10; 'output': 0.13; 'def': 0.13; '2016': 0.16; 'dfs': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'skip:| 20': 0.16; 'verbose': 0.16; 'wrote:': 0.16; 'skip:+ 40': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'keyboard': 0.22; 'name;': 0.22; 'pass': 0.22; 'import': 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'point.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'var': 0.27; 'print': 0.30; 'work.': 0.30; "i'd": 0.31; 'received:google.com': 0.35; 'something': 0.35; 'instead': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'doing': 0.38; 'received:209': 0.38; 'save': 0.60; 'your': 0.60; 'world': 0.64; 'chrisa': 0.84; 'to:none': 0.91; 'why?': 0.91 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; bh=dDlLks0yDFkZjfTnBUEx+pc6NUoBX7BiebBM3Jb6dws=; b=UsmNLNozQ/Fuz3nh7U9zzJUphXyAptZ6bFd834H8AWx60H8LcFjR6eRwiFLxZyAmDt 5kjykyzTAOCSXc0fXsoVPdMn4GZS/3lOwyweM6QeF5zMWpBqK89clSWEkyV6Jfa6k3zS XOzXNEdcqmDHq4M00g7AHKL61WPG6ayouj8mcWz1jrD1CzKTFznLuYfVWc8AAaLE2rLS 0ZiiAUrsxxNCXG87cqk5OwRTpjXmkebDVjf39iZSrbs9JduWvj47b//IDRosvnfROKBM uIrDs9SrbScPwMfK70rp4ZKkE1zemHXWcxetyZAom5wKqTkzwIumGvbf0WNqVnRHhV4a nG6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=dDlLks0yDFkZjfTnBUEx+pc6NUoBX7BiebBM3Jb6dws=; b=FIbGaj7MbjrGIas3kymvExTYKKWClw8F22Km169OiTjYR2diiNbBF0UIqjjHpVzbiU Ryf8Ig0tFhQ0+HkwnUNoczd8KAJLmuZim0reYTxlSsmqnQNCbjFCqnfKqJsdwXb+sefn Y9dCwjiAjNCO2IM0w/O1jBxtQkU7TXcSc3PMqCLvOnwIdllw8zPs24Pe0RxOMdE+S+uh u/wpg22yqQsu1RuRbzx4lYn9t/jbffu9FM3KluW9oTp81iwaR5sBx0yVVZWC+B8nLr8v gHCjtOeZ6eLJuD1PKvXWKyr7guKxmhrx04xWRPWPiX4uDzH2V/j1pYDQXX7dFw1/FqAF 54/Q== X-Gm-Message-State: AOPr4FWfZZE4UO33nEnEoSu2rnHWbI7tVMy5ee/Dz4JoVf+mAnPmD4A/cB4SrxgJk5crHaZW1yRNmy9XQOqulA== X-Received: by 10.112.189.1 with SMTP id ge1mr12479051lbc.9.1462681309817; Sat, 07 May 2016 21:21:49 -0700 (PDT) In-Reply-To: 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: X-Mailman-Original-References: <572eb1c3$0$1616$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:108336 On Sun, May 8, 2016 at 2:10 PM, DFS wrote: >>> +-------------------------+------------+ >>> |trailing-whitespace |59 | heh! >>> +-------------------------+------------+ >>> |multiple-statements |23 | do this to save lines. >>> Will continue doing it. >> >> >> Why? Do you think that there's a world shortage of newline characters? Is >> the Enter key on your keyboard broken? > > > I do it because I like it. > > if verbose: print var > > python doesn't complain. That's a massively-debated point. In that specific example, I'd support the one-liner; however, I'd also recommend this technique: # for Python 2, you need to start with this line from __future__ import print_function if verbose: verbiage = print else: def verbiage(*args): pass Then, instead of "if verbose: print(var)", you would use "verbiage(var)". Of course, you want something better than "verbiage" as your name; the nature of your verbose output might give a clue as to what name would work. ChrisA