Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: pylint woes Date: Mon, 9 May 2016 08:07:25 +1000 Lines: 31 Message-ID: References: <572eb1c3$0$1616$c3e8da3$5496439d@news.astraweb.com> <20160508085006.020cef65@imp> <7aadnaamRdfTOLLKnZ2dnUU7-eXNnZ2d@giganews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de l8rhLh/3o/OY9WNpxQnGnQshndWKzVMniKFMX2tZaJsA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'preference': 0.05; '(b)': 0.07; 'stops': 0.07; 'cc:addr:python-list': 0.09; 'abort': 0.09; '{},': 0.09; 'example:': 0.10; '2016': 0.16; 'doing,': 0.16; 'executed,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'means:': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'somewhere.': 0.16; 'wrote:': 0.16; 'obviously': 0.16; 'debugging': 0.18; 'stick': 0.18; 'gui': 0.18; 'variable': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '(a)': 0.22; 'am,': 0.23; '(or': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; 'idea': 0.28; 'end,': 0.29; 'larry': 0.29; 'optional.': 0.29; 'sensible': 0.29; 'print': 0.30; 'code': 0.30; 'normally': 0.30; "can't": 0.32; 'point': 0.33; 'problem': 0.33; 'values.': 0.33; 'similar': 0.33; 'info': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'but': 0.36; 'instead': 0.36; 'received:209.85': 0.36; '(and': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'received:209': 0.38; 'whatever': 0.39; 'where': 0.40; 'called': 0.40; 'some': 0.40; 'course': 0.62; 'personal': 0.63; 'between': 0.65; 'python-list': 0.66; 'worth': 0.67; 'prompt': 0.79; 'chrisa': 0.84; 'now).': 0.84; 'technique.': 0.84; 'variation': 0.84; 'to:none': 0.91; 'examine': 0.95 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=aazXFFhoFrQmV96stPdXUxNFoPOLpcdzjHjG55W7vVs=; b=dw6Iq5hnWNFyppjImKdsTcA8KuFg25cE735CN+D8gCeRYk05U+usOh2AQmJxv/msqH dGKJccF3mbD7tRg4+vPbI03xz/yQdv3SplBnyhLM/AT28gcuOOvjmFDreLf0FNvdzpyd 9jwB0wuFwT22rXGdUVC8ZUOceYROUvoAxV70irzBCDSkuqrEsQ2f/XdeOtA5D44MR5MK a92AYEzSreLK6t5qizfLMHyC0X+Dc2mnK2Z7fHuZ5RUpmNUT9i6LGRFWk+XeHJ9riGRl XzV9YptuvJtv2T6uW1AyuLG4HmkvH3ZIh6y/s4cmxvivVoLqgV+oTUg19ZxBYqoo+73G U6Dw== 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=aazXFFhoFrQmV96stPdXUxNFoPOLpcdzjHjG55W7vVs=; b=hRGuDOblHqIUD/J8e2qlTPuySqb2z2cB+PA94Doa/V9IwlptYKRALTEgrBpusI/Yy1 mS45cssqmAfFFbT1o5VOcPgUT/fNzi/EdCzZCEWkSdsiAU1S+xR2RqViphmaEIo5wulm TpsJuAgvvG8PERkHAuOmr+0K3C0qsx4ulbUYMzeLSAeLkNBL6Z+mvqh9p4UF2huE99C/ pSqNw2XgC1dE0IhYBIfVcL2VH1jNKTXQslDDAcp21N1Q2wRXPyPtbCYA3WsKdeQ9S7Rg gWdeT5pcgS5NPOAFaiIOMu8EQ7fM/hGhJytURRRHjL9bmQx5jZLKjrRGcBjjYMnxVD0P qXPA== X-Gm-Message-State: AOPr4FVfvvy4GsUJRc3T9Hd1J6B5JdzR0XNrBHHbMzTnz9l+Tj5aNxNPkiGf3FC9GgOlu0socMCrkUj5X5zhcw== X-Received: by 10.25.87.65 with SMTP id l62mr6288361lfb.4.1462745245668; Sun, 08 May 2016 15:07:25 -0700 (PDT) In-Reply-To: <7aadnaamRdfTOLLKnZ2dnUU7-eXNnZ2d@giganews.com> 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> <20160508085006.020cef65@imp> <7aadnaamRdfTOLLKnZ2dnUU7-eXNnZ2d@giganews.com> Xref: csiph.com comp.lang.python:108393 On Mon, May 9, 2016 at 6:45 AM, Larry Hudson via Python-list wrote: > On 05/08/2016 06:01 AM, Chris Angelico wrote: > [snip...] >> >> ... I like to recommend a >> little thing called "IIDPIO debugging" - If In Doubt, Print It Out. >> That means: If you have no idea what a piece of code is doing, slap in >> a print() call somewhere. It'll tell you that (a) the code is actually >> being executed, and (b) whatever info you put between the parens >> (ideally, some key variable or parameter)... > > > My personal variation of IIPPID debugging is to use input() instead of > print(). For example: > > input('x = {}, y = {} --> '.format(x, y)) > > Then the program stops at this point so you can examine the values. > will continue the program or ^C will abort (if you see what the problem is > now). Of course this can't be used in all situations, but it's handy where > it can. > > Note that my personal preference is to stick that "-->" as a prompt at the > end, but obviously this (or a similar marker) is optional. Neat technique. Not something to use *every* time (and not always sensible - eg you don't normally want to stall out a GUI thread), but definitely worth keeping in the arsenal. ChrisA