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


Groups > comp.lang.python > #78077

Re: Is there a canonical way to check whether an iterable is ordered?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'strict': 0.07; 'iterate': 0.09; 'subject:iterable': 0.09; 'cc:addr:python-list': 0.11; '(without': 0.16; 'correspond.': 0.16; 'dict': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'implies': 0.16; 'iterating': 0.16; 'followed': 0.16; 'wrote:': 0.18; '(in': 0.22; 'cc:addr:python.org': 0.22; 'logical': 0.24; 'cc:2**0': 0.24; 'order.': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'message-id:@mail.gmail.com': 0.30; 'keys': 0.31; 'sep': 0.31; 'fri,': 0.33; 'sense': 0.34; 'common': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'pm,': 0.38; 'does': 0.39; 'times': 0.62; 'guarantee': 0.63; 'subject:there': 0.68; 'guaranteed': 0.75; 'subject:check': 0.84; 'to:none': 0.92
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 :content-type; bh=XI+ioJztW0j/daXGp4GCz1VeY2KmPtHOr23oYW04WL0=; b=d7OOa7Y3VI61aBi+xTbeF2pn5AfNRqlHfWW+DcBOxu/UtpdIXdYsRPAjBbH4EZFSn1 dm94/Y4uTA7jbZnQYrLMjt+iQhHL5E3m2/GoNP7K6jbgvQgcMiExW5ptYsf/rbuBVRT1 cGbNDlPxl+3rUYUQJ/9SETb4UMLwFgbw2WBGyQ+j9DB8PCC0N9i5+fSC28z65iXZMCQo Cfr9TxXPqToulJ+FQrAO8Fop4TYXpY03ZgT47IG/Dqwgz5sj/2DlUUuE1gEk8kzQIM4l FIiB2h1S8nRWibIp5F+PDyYdMVHIhrs6N0//LBDO8rshv1QbEINpyg0MgR2eY9PJhjka /R9A==
MIME-Version 1.0
X-Received by 10.43.94.7 with SMTP id bw7mr871671icc.26.1411130219409; Fri, 19 Sep 2014 05:36:59 -0700 (PDT)
In-Reply-To <LhVSv.277010$177.123397@fx04.am4>
References <efcc61e6-f132-4f14-80b5-0536816b6c7b@googlegroups.com> <mailman.14101.1411042251.18130.python-list@python.org> <roy-E21095.08580518092014@news.panix.com> <541bbbe6$0$29982$c3e8da3$5496439d@news.astraweb.com> <mailman.14134.1411105214.18130.python-list@python.org> <541c0c7d$0$29992$c3e8da3$5496439d@news.astraweb.com> <mailman.14141.1411125907.18130.python-list@python.org> <541c177a$0$29969$c3e8da3$5496439d@news.astraweb.com> <mailman.14143.1411127768.18130.python-list@python.org> <LhVSv.277010$177.123397@fx04.am4>
Date Fri, 19 Sep 2014 22:36:59 +1000
Subject Re: Is there a canonical way to check whether an iterable is ordered?
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.14145.1411130223.18130.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1411130223 news.xs4all.nl 2904 [2001:888:2000:d::a6]:40683
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78077

Show key headers only | View raw


On Fri, Sep 19, 2014 at 10:26 PM, alister
<alister.nospam.ware@ntlworld.com> wrote:
> As far as I understand it the order of keys in a dict is not guaranteed
> iterating over the same dict twice (without changes) does not have to
> return the keys in the same order.

The exact guarantee is that you can iterate over keys() followed by
values() and they will correspond. This implies (in the strict logical
sense of the word "implies", as well as the common sense of the same
word) that iterating multiple times over keys() will correspond, which
is the point I drew above.

ChrisA

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


Thread

Is there a canonical way to check whether an iterable is ordered? cool-RR <ram.rachum@gmail.com> - 2014-09-18 04:55 -0700
  Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-18 22:10 +1000
    Re: Is there a canonical way to check whether an iterable is ordered? Roy Smith <roy@panix.com> - 2014-09-18 08:58 -0400
      Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-18 23:33 +1000
        Re: Is there a canonical way to check whether an iterable is ordered? Roy Smith <roy@panix.com> - 2014-09-18 19:52 -0400
          Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-19 12:45 +1000
          Re: Is there a canonical way to check whether an iterable is ordered? Terry Reedy <tjreedy@udel.edu> - 2014-09-19 18:02 -0400
          Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-20 15:01 +1000
      Re: Is there a canonical way to check whether an iterable is ordered? Terry Reedy <tjreedy@udel.edu> - 2014-09-18 09:46 -0400
      Re: Is there a canonical way to check whether an iterable is ordered? Tim Chase <python.list@tim.thechases.com> - 2014-09-18 09:32 -0500
      Re: Is there a canonical way to check whether an iterable is ordered? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-19 15:15 +1000
        Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-19 15:40 +1000
          Re: Is there a canonical way to check whether an iterable is ordered? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-19 20:59 +1000
            Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-19 21:19 +1000
              Re: Is there a canonical way to check whether an iterable is ordered? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-19 21:58 +1000
                Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-19 22:06 +1000
            Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-19 21:25 +1000
              Re: Is there a canonical way to check whether an iterable is ordered? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-19 21:46 +1000
                Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-19 21:56 +1000
                Re: Is there a canonical way to check whether an iterable is ordered? alister <alister.nospam.ware@ntlworld.com> - 2014-09-19 12:26 +0000
                Re: Is there a canonical way to check whether an iterable is ordered? Chris Angelico <rosuav@gmail.com> - 2014-09-19 22:36 +1000
  Re: Is there a canonical way to check whether an iterable is ordered? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-19 15:04 +1000

csiph-web