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


Groups > comp.lang.python > #108508

Re: pylint woes

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From MRAB <python@mrabarnett.plus.com>
Newsgroups comp.lang.python
Subject Re: pylint woes
Date Wed, 11 May 2016 02:02:01 +0100
Lines 49
Message-ID <mailman.583.1462928532.32212.python-list@python.org> (permalink)
References <ngl677$68p$1@dont-email.me> <CAPTjJmr7A+UH7Wye05_T5WV0kG=DQUrOF2Mc8-uGQ26HKAoCMg@mail.gmail.com> <mailman.457.1462640479.32212.python-list@python.org> <ngm3qs$73r$1@dont-email.me> <CAPTjJmqBzdVqY+3nVJWX-fCFo5RHrwfqvo3DqX1jP3=AFV4Bpw@mail.gmail.com> <mailman.487.1462671388.32212.python-list@python.org> <ngm79s$d60$1@dont-email.me> <CAPTjJmq4Uqiz-5BO=StiMfg+jjnQyG4HPQ+Sh+qb4UWWFvLReQ@mail.gmail.com> <mailman.493.1462675848.32212.python-list@python.org> <ngtnja$cni$1@dont-email.me> <00fa454d-3a62-6282-89dd-d84005db9891@mrabarnett.plus.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de SBdIAaOQ+aFNxQPOTCdeFgS4UL8Q758MYXaTiRP2ftZg==
Return-Path <python@mrabarnett.plus.com>
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; 'fixed,': 0.09; 'iterate': 0.09; 'example:': 0.10; 'python': 0.10; '100,': 0.16; 'dfs': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'invalid.': 0.16; 'iterates': 0.16; 'iterator': 0.16; 'list1': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'truncates': 0.16; 'wrote:': 0.16; 'arguments': 0.22; '(like': 0.23; 'bigger': 0.23; 'header:In- Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'error': 0.27; 'correct': 0.28; 'values': 0.28; 'possibly': 0.32; 'received:84': 0.32; 'point': 0.33; 'lists': 0.34; 'list': 0.34; 'gets': 0.35; 'could': 0.35; 'smaller': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'beyond': 0.37; 'data': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'no.': 0.62; 'matter': 0.63; 'more': 0.63; 'results': 0.66; 'grow': 0.75; '100': 0.79; '102': 0.84; 'enumeration': 0.84
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=bsGxfxui c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=kBpTiQKTDzyPKJuxhDIA:9 a=SmT50CT9l8uubLgb:21 a=tqyXVyzs00ZKss4F:21 a=QEXdDO2ut3YA:10
X-AUTH mrabarnett@:2500
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0
In-Reply-To <ngtnja$cni$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 <00fa454d-3a62-6282-89dd-d84005db9891@mrabarnett.plus.com>
X-Mailman-Original-References <ngl677$68p$1@dont-email.me> <CAPTjJmr7A+UH7Wye05_T5WV0kG=DQUrOF2Mc8-uGQ26HKAoCMg@mail.gmail.com> <mailman.457.1462640479.32212.python-list@python.org> <ngm3qs$73r$1@dont-email.me> <CAPTjJmqBzdVqY+3nVJWX-fCFo5RHrwfqvo3DqX1jP3=AFV4Bpw@mail.gmail.com> <mailman.487.1462671388.32212.python-list@python.org> <ngm79s$d60$1@dont-email.me> <CAPTjJmq4Uqiz-5BO=StiMfg+jjnQyG4HPQ+Sh+qb4UWWFvLReQ@mail.gmail.com> <mailman.493.1462675848.32212.python-list@python.org> <ngtnja$cni$1@dont-email.me>
Xref csiph.com comp.lang.python:108508

Show key headers only | View raw


On 2016-05-10 23:36, DFS wrote:
[snip]
>
> If lists are still being created:
>
> * at every moment in time, len(list1) returns a length that doesn't
> change even if data is added to the list after the call to len().
>
> Example: If the list has 100 items in it at the point len(list) is called:
>
> for i in range(len(list1))
>
> will never iterate more than 100x, no matter how large list1 grows to.
>
> Caveat: since list1 may be bigger or smaller than the other lists at
> that moment in time, an error may occur when using list2[i], list3[i].
>
>
> Is that all correct as you understand it?
>
Yes.
>
>
> * at every moment in time, zip(list1, list2, etc) will return a fixed,
> same-length lists of tuples, which doesn't change even if data is added
> to any of the lists after the call to zip().
>
> Example: if the lists have 100, 97 and 102 items in them at the point
> zip(lists) is called:
>
> for item1, item2, item3 in zip(list1, list2, list3)
>
> will never iterate beyond 97x, even if the lists grow while the
> enumeration is occurring.
>
> Caveat: since zip() possibly truncates lists, the results - the usage of
> the data - could be completely invalid.
>
>
> Is that all correct as you understand it?
>
In Python 2, zip iterates through the arguments immediately and returns 
a list of tuples, so the answer is yes.

In Python 3, zip returns a lazy iterator (like itertools.izip in Python 
2) that gets the values from the arguments _on demand_, so the answer is no.

[snip]

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