Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #108394

Re: pylint woes

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: pylint woes
Date Mon, 9 May 2016 08:10:44 +1000
Lines 35
Message-ID <mailman.534.1462745446.32212.python-list@python.org> (permalink)
References <ngl677$68p$1@dont-email.me> <572eb1c3$0$1616$c3e8da3$5496439d@news.astraweb.com> <ngme1a$t50$1@dont-email.me> <CAPTjJmpg6BhNb+vTv0+3FnEw5CaK7OWHs948bPKe7K4P=mdPXw@mail.gmail.com> <20160508085006.020cef65@imp> <CAPTjJmp2ASc2aaU1imAgoXZoX2nBO4UYHf-DK_vx0vGdh=5yBQ@mail.gmail.com> <mailman.510.1462712523.32212.python-list@python.org> <ngo8pe$o7r$1@dont-email.me> <CAPTjJmqNg7y75QOxTujnY5+3r1J7FrGtuUGtdfxda1v=5ovL=A@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de mak7Hg81DtS4LcUIxvNx1gTa+fnanjsAem91UIKPUayA==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; '(b)': 0.07; 'familiarity': 0.07; 'properly.': 0.07; 'cc:addr:python-list': 0.09; 'frameworks,': 0.09; 'output?': 0.09; 'languages,': 0.15; '2016': 0.16; 'agree.': 0.16; 'centralized': 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; 'verbose': 0.16; 'wrote:': 0.16; 'debugging': 0.18; ';-)': 0.18; 'variable': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '(a)': 0.22; 'controlling': 0.22; 'function,': 0.22; 'am,': 0.23; 'bit': 0.23; 'for?': 0.23; 'header:In-Reply-To:1': 0.24; 'all.': 0.24; 'mon,': 0.24; 'module': 0.25; "doesn't": 0.26; 'chris': 0.26; 'error': 0.27; 'logging': 0.27; 'wonder': 0.27; 'message- id:@mail.gmail.com': 0.27; 'idea': 0.28; 'developing': 0.28; 'fine': 0.28; 'dan': 0.29; 'disabling': 0.29; 'prints': 0.29; 'print': 0.30; 'work.': 0.30; 'code': 0.30; 'programmers': 0.30; 'embedded': 0.32; 'control,': 0.33; 'suddenly': 0.33; 'info': 0.34; 'received:google.com': 0.35; 'trouble': 0.35; 'next': 0.35; "isn't": 0.35; 'but': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'say': 0.37; 'doing': 0.38; 'received:209': 0.38; 'why': 0.39; 'whatever': 0.39; "didn't": 0.39; 'called': 0.40; 'some': 0.40; 'easy': 0.60; 'reach': 0.61; 'more': 0.63; 'between': 0.65; 'superior': 0.67; 'teach': 0.70; 'sounds': 0.76; '(also,': 0.84; '+1000,': 0.84; 'absolutely.': 0.84; 'chrisa': 0.84; 'etc,': 0.84; 'to:none': 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=BIq3qZzqjmvz0YM5+OAgu7djVlYG4IhtdidqJcP4Qvw=; b=tJ3306WBqxh72DIAcc/QuVQAguPf7r5HWWssD0GUsj0Xd3NcomqWpxOFFtZLOFipOi LWL9fQg7WY1Nh+CaRarK246DYb2VQqPXg+9TrSo3dv/3sjECeKQgZ67p8T7Be8FD+YFp 0+/U2M4epRSDlYhkN1URl5LnmKE9euvQPJ6tivOJp5RU/cw4Cl9OZ4Gel1BDrQBgxxxl kKOcdU2fLkZcnbLgWKauGHRSkZ5oT5WnpXRRpGjbGH1ffKfO5DxQQc9nCWcIKyUSwokZ oNmDEJxIIXr37/m8ghflEXXlxubRji7UKQAdYfvDcNPMHEnH4AcmSZsJYv7QHzVXnjhE jbQw==
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=BIq3qZzqjmvz0YM5+OAgu7djVlYG4IhtdidqJcP4Qvw=; b=gGWuPn8YitHYhp5NLpP9godWfaF8meOdNyCxWq4/wruZGJ4yBO+Q6nD/pvlTyhSpzo KMsl+vM975bvQ6N5WznhzvoZsAueZ8GK1uWRvMg/OJy9Cqfio89UOEEFQJPfRW5RFODD mB6ygPwXc9PcgV89He5kV9SrcctwOYVRsktmHF+xcbPU8dsUn7onCewedOdknKxHDmwA T9ZAf/7kPqHegyYdZOSQuLTPByNH8AoA5EqKFUxZ2Jz1xcggM2b7bV5TjatBeW24ShTv 4T1byCASglNNJBWeXQoSsNVUNYrjN4ZEGpiXRCBTMrjNWX7lhssGR+cOXWcPGCVtG/98 M47g==
X-Gm-Message-State AOPr4FWdiTuObSUfxNekrhhMnHDzJsuuJB2R6lPAPuzu6RHRoEVf0v8viLqhC+eE/WTHAx7iB/CvB5jkdI8pZQ==
X-Received by 10.25.79.12 with SMTP id d12mr13774728lfb.68.1462745444293; Sun, 08 May 2016 15:10:44 -0700 (PDT)
In-Reply-To <ngo8pe$o7r$1@dont-email.me>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAPTjJmqNg7y75QOxTujnY5+3r1J7FrGtuUGtdfxda1v=5ovL=A@mail.gmail.com>
X-Mailman-Original-References <ngl677$68p$1@dont-email.me> <572eb1c3$0$1616$c3e8da3$5496439d@news.astraweb.com> <ngme1a$t50$1@dont-email.me> <CAPTjJmpg6BhNb+vTv0+3FnEw5CaK7OWHs948bPKe7K4P=mdPXw@mail.gmail.com> <20160508085006.020cef65@imp> <CAPTjJmp2ASc2aaU1imAgoXZoX2nBO4UYHf-DK_vx0vGdh=5yBQ@mail.gmail.com> <mailman.510.1462712523.32212.python-list@python.org> <ngo8pe$o7r$1@dont-email.me>
Xref csiph.com comp.lang.python:108394

Show key headers only | View raw


On Mon, May 9, 2016 at 6:49 AM, Dan Sommers <dan@tombstonezero.net> wrote:
> On Sun, 08 May 2016 23:01:55 +1000, Chris Angelico wrote:
>
>> ... 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). Part A is often the important bit :) ...
>
> Having spent a long time developing embedded systems, I wholeheartedly
> agree.  In spirit.  Isn't that what the logging module is for?  Fine
> grained control, as centralized or distributed as is warranted, over
> program output?
>
>> ... The trouble with a verbose flag controlling all print() calls is
>> that IIDPIO debugging suddenly doesn't work; plus, it's easy to copy
>> and paste code to some other module and not notice that you don't have
>> a verbosity check at the top, and then wonder why disabling verbose
>> doesn't fully work. Both problems are solved by having a dedicated
>> spam function, which will simply error out if you didn't set it up
>> properly.
>
> Hey!  That sounds just like the logging module....  ;-)

Absolutely. I say "print" in IIDPIO because it's a word that people
understand across languages, across frameworks, etc, etc, but when you
start doing more of it, the logging module is definitely superior - if
you need just one reason to use it, it would be to *leave those prints
in place* so the next person doesn't need to reach for IIDPIO at all.

(Also, I teach print() because it's one less module to explain. But
experienced programmers should get some familiarity with it.)

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

pylint woes DFS <nospam@dfs.com> - 2016-05-07 12:51 -0400
  Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 03:01 +1000
    Re: pylint woes DFS <nospam@dfs.com> - 2016-05-07 21:16 -0400
      Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 11:36 +1000
        Re: pylint woes DFS <nospam@dfs.com> - 2016-05-07 22:15 -0400
          Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 12:50 +1000
            Re: pylint woes DFS <nospam@dfs.com> - 2016-05-10 18:36 -0400
              Re: pylint woes MRAB <python@mrabarnett.plus.com> - 2016-05-11 02:02 +0100
      Re: pylint woes Stephen Hansen <me+python@ixokai.io> - 2016-05-07 19:14 -0700
        Re: pylint woes DFS <nospam@dfs.com> - 2016-05-07 23:04 -0400
          Re: pylint woes Stephen Hansen <me+python@ixokai.io> - 2016-05-07 20:46 -0700
            Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 10:26 -0400
          Re: pylint woes Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-05-08 08:50 +0300
            Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 10:25 -0400
              Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-09 00:36 +1000
                Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 11:06 -0400
                Re: pylint woes Stephen Hansen <me+python@ixokai.io> - 2016-05-08 08:15 -0700
                Re: pylint woes Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-05-09 13:17 +1200
                Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-09 12:18 +1000
                Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 22:58 -0400
                Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-09 01:15 +1000
                Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 17:06 -0400
              Re: pylint woes Stephen Hansen <me+python@ixokai.io> - 2016-05-08 08:11 -0700
              Re: pylint woes Steven D'Aprano <steve@pearwood.info> - 2016-05-09 01:51 +1000
                Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 17:04 -0400
                Re: pylint woes Steven D'Aprano <steve@pearwood.info> - 2016-05-09 13:09 +1000
      Re: pylint woes MRAB <python@mrabarnett.plus.com> - 2016-05-08 03:21 +0100
      Re: pylint woes Steven D'Aprano <steve@pearwood.info> - 2016-05-08 21:36 +1000
        Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 17:24 -0400
          Re: pylint woes Joel Goldstick <joel.goldstick@gmail.com> - 2016-05-08 17:39 -0400
          Re: pylint woes Steven D'Aprano <steve@pearwood.info> - 2016-05-09 13:46 +1000
  Re: pylint woes Michael Selik <michael.selik@gmail.com> - 2016-05-07 18:42 +0000
  Re: pylint woes Peter Pearson <pkpearson@nowhere.invalid> - 2016-05-07 18:43 +0000
    Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 17:05 -0400
  Re: pylint woes Christopher Reimer <christopher_reimer@icloud.com> - 2016-05-07 11:52 -0700
    Re: pylint woes DFS <nospam@dfs.com> - 2016-05-07 23:38 -0400
      Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 13:56 +1000
      Re: pylint woes Peter Otten <__peter__@web.de> - 2016-05-08 16:19 +0200
  Re: pylint woes Stephen Hansen <me+python@ixokai.io> - 2016-05-07 12:21 -0700
  Re: pylint woes Stephen Hansen <me@ixokai.io> - 2016-05-07 12:23 -0700
  Re: pylint woes Terry Reedy <tjreedy@udel.edu> - 2016-05-07 15:40 -0400
    Re: pylint woes DFS <nospam@dfs.com> - 2016-05-07 23:28 -0400
      Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 13:51 +1000
        Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 00:40 -0400
          Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 14:55 +1000
      Re: pylint woes Stephen Hansen <me+python@ixokai.io> - 2016-05-07 20:55 -0700
      Re: pylint woes Ian Kelly <ian.g.kelly@gmail.com> - 2016-05-07 23:09 -0600
      Re: pylint woes Peter Otten <__peter__@web.de> - 2016-05-08 16:12 +0200
  Re: pylint woes Christopher Reimer <christopher_reimer@icloud.com> - 2016-05-07 12:43 -0700
  Re: pylint woes Ray Cote <rgacote@appropriatesolutions.com> - 2016-05-07 15:52 -0400
  Re: pylint woes Christopher Reimer <christopher_reimer@icloud.com> - 2016-05-07 13:20 -0700
  Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 07:56 +1000
  Re: pylint woes Terry Reedy <tjreedy@udel.edu> - 2016-05-07 21:44 -0400
  Re: pylint woes Steven D'Aprano <steve@pearwood.info> - 2016-05-08 13:25 +1000
    Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 00:10 -0400
      Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 14:21 +1000
      Re: pylint woes "D'Arcy J.M. Cain" <darcy@VybeNetworks.com> - 2016-05-08 08:50 -0400
      Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-08 23:01 +1000
        Re: pylint woes Larry Hudson <orgnut@yahoo.com> - 2016-05-08 13:45 -0700
          Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-09 08:07 +1000
            Re: pylint woes Larry Hudson <orgnut@yahoo.com> - 2016-05-08 18:28 -0700
        Re: pylint woes Dan Sommers <dan@tombstonezero.net> - 2016-05-08 20:49 +0000
          Re: pylint woes Chris Angelico <rosuav@gmail.com> - 2016-05-09 08:10 +1000
      Re: pylint woes Steven D'Aprano <steve@pearwood.info> - 2016-05-09 03:25 +1000
        Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 17:16 -0400
          Re: pylint woes Stephen Hansen <me+python@ixokai.io> - 2016-05-08 14:38 -0700
            Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 17:46 -0400
              Re: pylint woes Stephen Hansen <me+python@ixokai.io> - 2016-05-08 15:05 -0700
                Re: pylint woes DFS <nospam@dfs.com> - 2016-05-08 18:24 -0400

csiph-web