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


Groups > comp.lang.python > #108332

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 Sun, 8 May 2016 13:51:03 +1000
Lines 56
Message-ID <mailman.499.1462679465.32212.python-list@python.org> (permalink)
References <ngl677$68p$1@dont-email.me> <nglgb9$lkb$1@ger.gmane.org> <mailman.468.1462650038.32212.python-list@python.org> <ngmbj9$nk4$1@dont-email.me> <CAPTjJmrV0WszPZd+F2h-54b4Zbt-=0qAW3a_xyj3WL5L2ydZLg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de Rz0Hr9n8VyglZXRCdxKT2gkknItZbLjKR1QZ5KfTPWAw==
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; 'lines,': 0.05; 'builtin': 0.07; 'cc:addr:python-list': 0.09; 'constants.': 0.09; 'splitting': 0.09; 'ignore': 0.14; '(var': 0.16; '2016': 0.16; 'complained': 0.16; 'dfs': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 're,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sense,': 0.16; 'something.': 0.16; 'statments': 0.16; 'wrote:': 0.16; 'skip:+ 40': 0.18; 'switched': 0.18; 'variable': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'otherwise,': 0.20; 'fix': 0.21; 'constant': 0.22; 'os,': 0.22; 'import': 0.24; 'examples': 0.24; 'header:In-Reply-To:1': 0.24; 'separate': 0.27; 'message- id:@mail.gmail.com': 0.27; 'function': 0.28; 'skip:( 20': 0.28; 'code': 0.30; 'received:209.85.215.46': 0.30; 'error.': 0.31; 'probably': 0.31; "can't": 0.32; 'says': 0.32; 'problem': 0.33; 'list': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'comment': 0.35; 'but': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'modules': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'seem': 0.37; 'things': 0.38; 'received:209': 0.38; 'means': 0.39; 'cut': 0.67; 'choose': 0.68; '"miles"': 0.84; '"too': 0.84; 'chrisa': 0.84; 'easy!': 0.84; 'skip:| 10': 0.84; 'surround': 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=Xy+NKKDA9X0M4OKoUZLUJHHai1zA030nVmy6A9dqMsQ=; b=Yo8kwpjjKt5EMKa+Uil2w1I1jVtuXhhm3JKjQLyoxXfxtr+b4wcUMBetrS3uLW9cKI l1wY8AkhgYgr/Li4xhLuYro7zXyracXmsc+yaw6DcoulHLvuS3E1MlrUayHVkWj57M8n r74BxV2gKjdnijPKwcOWihlmhk+kz3d5lc/2riVx2kl9SQpM0EVbsIHJ1vWfYhIR3wA1 fJmsEnkDLOq03Uhw7bfLKFaxSh3Vcbev6N/2QUvzSY3/XV8fJ7q1lVjFB/vPH5ATCn1a b9X6GdK7JaMFIMGph/MLYJmxO8ze70cStGZQDqfXK/9vsuXzMnYRnOVAVD7J2/k7e4OV RqXA==
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=Xy+NKKDA9X0M4OKoUZLUJHHai1zA030nVmy6A9dqMsQ=; b=NMGeAyCO//O6fMNR3TYIYNeE5w1SRZvWyUWDZmip09dB9b+ACE1p5uv1+VGiLr7dGq qSM9VkmOmnx1q8cJAsoNLdDeKbienyTrcFDjXQoAK7ndsYfwnrA7j0xLczpsyPtvM8Uv s2nxP+Y7RYJYTRWdhEwQcXe3t5D6N4rKcjJtm8FkjYTSu6cLX8MNv36cXZ3OUf0eUG0d G/EWpYv536T0xKp7BJNY/caLTmL1tLvCQXG/lYO+lPo7zEjt6qJ0HiMPCLoeWlOMT/aC r9OVMfnd4Ri7ec/LiaUA0nkQwvJhf+FD+a0Um7mrq4WYgO1DhYeAtM/e1CztXeWUz50M HtkA==
X-Gm-Message-State AOPr4FWlkem+ktERtdu6Mqs7G+dmFw67VRJcFD59TC2uLAjbPVKBVczUWLsEVskU8hHeECq4/STIhtYv4TQeOw==
X-Received by 10.112.189.1 with SMTP id ge1mr12442830lbc.9.1462679463207; Sat, 07 May 2016 20:51:03 -0700 (PDT)
In-Reply-To <ngmbj9$nk4$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 <CAPTjJmrV0WszPZd+F2h-54b4Zbt-=0qAW3a_xyj3WL5L2ydZLg@mail.gmail.com>
X-Mailman-Original-References <ngl677$68p$1@dont-email.me> <nglgb9$lkb$1@ger.gmane.org> <mailman.468.1462650038.32212.python-list@python.org> <ngmbj9$nk4$1@dont-email.me>
Xref csiph.com comp.lang.python:108332

Show key headers only | View raw


On Sun, May 8, 2016 at 1:28 PM, DFS <nospam@dfs.com> wrote:
> Invalid constant name "cityzip" (invalid-name)
> Invalid constant name "state" (invalid-name)
> Invalid constant name "miles" (invalid-name)
> Invalid constant name "store" (invalid-name)
> Invalid variable name "rs" (invalid-name)

... huh?? The first four seem to have been incorrectly detected as
constants. How are they used?

The last one is probably "too short". Or something.

> standard import "import re, requests" comes before "import pyodbc, sqlite3"
> (wrong-import-order)
>
>   * So I switched them, and then it complained about that:
>
> standard import "import pyodbc, sqlite3" comes before "import re, requests"
> (wrong-import-order)
>
> -------------------------------------------------------------------------
>
> You can't win with pylint...

Probably that means it got confused by the alphabetization - "pyodbc"
should come before "re" and "requests", but "sqlite3" should come
after. Either fix the first problem by splitting them onto separate
lines, or ignore this as a cascaded error.

My general principle is that things on one line should *belong* on one
line. So having "import re, requests" makes no sense, but I might have
something like "import os, sys" when the two modules are both used in
one single line of code and never again. Otherwise, splitting them out
is the easiest.


>>> +-------------------------+------------+
>>> |superfluous-parens       |3           | I like to surround 'or'
>>>                                          statments with parens
>>
>>
>> I would need examples to comment
>
>
>
> if ("Please choose a state" in str(matches)):
> if (var == "val" or var2 == "val2"):

Cut the parens. Easy!

> It says "Used builtin function 'filter'. Using a list comprehension can be
> clearer. (bad-builtin)"

Kill that message and keep using filter.

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