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


Groups > comp.lang.python > #106151

Re: Suggestion: make sequence and map interfaces more similar

Path csiph.com!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Marco Sulla <mail.python.org@marco.sulla.e4ward.com>
Newsgroups comp.lang.python
Subject Re: Suggestion: make sequence and map interfaces more similar
Date Thu, 31 Mar 2016 14:49:51 +0200
Lines 29
Sender forwardedby@e4ward.com
Message-ID <mailman.255.1459428643.28225.python-list@python.org> (permalink)
References <CABbU2U_DsSC=6d0HOwgGnzQZ0=r6U2sf_zOJP0U_w7_i0RrOKQ@mail.gmail.com> <mailman.92.1459101740.28225.python-list@python.org> <56f8836b$0$1602$c3e8da3$5496439d@news.astraweb.com> <56FA8C71.4050306@rece.vub.ac.be> <CAPTjJmqjgnDvzS7=_YRf+T78GYz7J26FzWGfwrygYLeq2E9FeA@mail.gmail.com> <CABbU2U9m-35UqK5KqRj7Y_oLdq_dgH3_EScLb4Sf3UNB4oCgmQ@mail.gmail.com> <CAPTjJmp1x-5=gEwBB=n-kt6YeVd6OiN_BGh5tNoL7UPYNqKb8w@mail.gmail.com> <mailman.176.1459309120.28225.python-list@python.org> <56fb677f$0$11121$c3e8da3@news.astraweb.com> <mailman.197.1459342226.28225.python-list@python.org> <56fbf879$0$1591$c3e8da3$5496439d@news.astraweb.com> <mailman.218.1459356740.28225.python-list@python.org> <56fc8f20$0$1600$c3e8da3$5496439d@news.astraweb.com> <CABbU2U9VWxzAsuc6jECfkatoh_Od2Tbfa2cSnY9hnufhg8khYA@mail.gmail.com> <ndj597$tb4$1@ger.gmane.org>
Reply-To mail.python.org@marco.sulla.e4ward.com
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de FgIEmce4eDfKGsh36n6B8APCht96oISfTRfEl0b6En/A==
Return-Path <14141.gmail.com@bounce.e4ward.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'sequences.': 0.07; '"if': 0.09; 'dict': 0.09; 'immutable': 0.09; 'indexes': 0.09; 'iterate': 0.09; 'rossum': 0.09; 'similar,': 0.09; 'missed': 0.15; 'argument': 0.15; '2016': 0.16; 'integers.': 0.16; 'iterated': 0.16; 'iterates': 0.16; 'iteration': 0.16; 'keys.': 0.16; 'lookups': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:interfaces': 0.16; 'subject:make': 0.16; 'wrote:': 0.16; 'comparing': 0.18; 'proposed': 0.20; 'default,': 0.22; 'friend.': 0.22; 'keys': 0.22; 'lawrence': 0.22; 'suppose': 0.22; 'wrote': 0.23; 'header:In- Reply-To:1': 0.24; 'van': 0.26; 'message-id:@mail.gmail.com': 0.27; 'sequence': 0.27; 'values': 0.28; 'interface': 0.29; 'pep': 0.29; 'url:peps': 0.29; 'skip:_ 10': 0.32; 'url:python': 0.33; 'focusing': 0.33; 'previous': 0.34; 'add': 0.34; 'received:google.com': 0.35; 'header:Received:8': 0.35; 'mapping': 0.35; 'maps': 0.35; 'url:dev': 0.35; 'supports': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'received:209': 0.38; 'thank': 0.38; 'why': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'some': 0.40; 'default': 0.61; 'subject:more': 0.61; 'more': 0.63; 'march': 0.64; 'other.': 0.64; 'between': 0.65; 'python-list': 0.66; 'said:': 0.66; 'header :Reply-To:1': 0.67; 'natural': 0.67; 'dear': 0.67; 'reply-to:no real name:2**0': 0.71; 'confirming': 0.84; 'observed': 0.84; 'received:23': 0.84; 'convinced': 0.93
Authentication-Results dfw.e4ward.com (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=e4ward.com
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=e4ward.com; h= reply-to:content-type:content-type:subject:subject:message-id :date:date:from:from:references:in-reply-to:mime-version; s= mail; t=1459428633; x=1459515034; bh=FKB0TZMMHGOoI8m6V4kHyEtHkED 3s//yrz94hADZb/k=; b=rozMSpgQjDAZ8bstCtzId4ULtZDEFpbn1dE30awozI9 hFZZo0S1R2ykFcglyIBE90Pt2opdt4G7ABXNpv4i+/iH8XPROlptL9bVhCFn9m7T qTUYGRD+vFz/t29T3oddjUoWeot3RT7zLTNgrJKON2pqjHv7vNKMd1Mf5lY5zbXc =
Authentication-Results dfw.e4ward.com (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=gmail.com
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=FKB0TZMMHGOoI8m6V4kHyEtHkED3s//yrz94hADZb/k=; b=F5+1FAKRLDbW27X/UyZTadkkD8GUdsm7kZUXgv6wK5JIIIIYUFbj5qpo5xDA8Vw4XP NeICLiKiB8md3mlDd+pa0ub6ACsYpeLjTX5UBRKwbFM4aQ5gKwfUTOkP6kW0Xhut+Eiy hoKcYj/KCn3co630NUbhy7pDo1coIkUXvMARHsxt2s+h0FilkWQ8Mz7RvQ5jfQsvHBPx eiWZlTw7230Fhw5vy4Eg1ygKV/C/i+zY2P13Vs3pKkplC3H7Dr/dZbu4xWY8FW/hlGEc S52cTG7CGHptQ3uZr1tdQnEvwQYe/C79IEchQ+EZM3uQvKtQtKLX/jwT9s4iem8u17fE ObsQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=FKB0TZMMHGOoI8m6V4kHyEtHkED3s//yrz94hADZb/k=; b=H3hHsdKMaf+Vr35Uo6sT+DHiphjxi4Jizjsa1S0B3IBFVKRc0CDFpUWdwqn8m3rdlf TdjyaN2t0W7xwTCx+WpZGzdI/hWLbwbpxuKRIsDrvt7W4duTg9HtkwqFUlj6z251uWC8 s9Ro6pcX5CC/+x31m5dg4cdxSqM1IomXfOIkY5qKk+dlJu5HkIa6wYQyJlQOlHufuhjC z8foksJzSWIKICYPk1YjoJTbY5UEzz8ZMgOzkXWZkYl3S7q/j/ZUoJzRM5ddOhqXm6bO XN1H70W8uuu5cUE6FvvoXN7wpnx2ZG3aMNiYKVRIHO4mT1am9qhZoziy4dbYzNG0WZeL f35g==
X-Gm-Message-State AD7BkJKmTuAIiSwa9LCg+mMQ78W1NGMBmojq/5MxtK2kLz02CTB6lSDmiNFFn+tCbIb+sDISivIc4Fw+naUfeg==
X-Received by 10.107.8.30 with SMTP id 30mr1875271ioi.60.1459428630814; Thu, 31 Mar 2016 05:50:30 -0700 (PDT)
In-Reply-To <ndj597$tb4$1@ger.gmane.org>
X-Google-Sender-Auth VwvNEmVlrYAPjnseEvQqhoEth_s
X-e4ward-RCPT python-list.python.org-mail.python.org.marco.sulla.e4ward.com@ftcw4rx8877.reply.e4ward.com
X-e4ward-x .
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
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>
Xref csiph.com comp.lang.python:106151

Show key headers only | View raw


I want also to add that we are focusing on sequences, but my proposal
is also to make map interface more similar, introducing a vdict type
that iterates over values, and this will be for me really more
practical. PEP 234 (  http://legacy.python.org/dev/peps/pep-0234/ )
never convinced me. Van Rossum said:

> The symmetry between "if x in y" and "for x in y"
> suggests that it should iterate over keys.  This symmetry has been
> observed by many independently and has even been used to "explain"
> one using the other.  This is because for sequences, "if x in y"
> iterates over y comparing the iterated values to x.

This argument will never convinced me. It's a lot more practical (as
Van Rossum admitted further) to iterate over values by default on
maps. Furthermore I see much more symmetry between keys of maps and
indexes of sequences, so it's much more natural to make map iteration
over values by default, as for sequences. This is why I proposed a
vdict.


On 31 March 2016 at 14:30, Mark Lawrence via Python-list
<python-list@python.org> wrote:
> Note that dict also supports
> __getitem__() and __len__(), but is considered a mapping rather than a
> sequence because the lookups use arbitrary immutable keys rather than
> integers.

Thank you for confirming for what I already wrote and quoted, but I suppose you
missed some of my previous messages, my dear friend.

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


Thread

Re: Suggestion: make sequence and map interfaces more similar "Marco S." <mail.python.org@marco.sulla.e4ward.com> - 2016-03-27 20:01 +0200
  Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-28 12:05 +1100
    Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-29 16:08 +0200
    Re: Suggestion: make sequence and map interfaces more similar Chris Angelico <rosuav@gmail.com> - 2016-03-30 01:31 +1100
    Re: Suggestion: make sequence and map interfaces more similar Marco Sulla <mail.python.org@marco.sulla.e4ward.com> - 2016-03-30 00:29 +0200
    Re: Suggestion: make sequence and map interfaces more similar Terry Reedy <tjreedy@udel.edu> - 2016-03-29 20:55 -0400
    Re: Suggestion: make sequence and map interfaces more similar Chris Angelico <rosuav@gmail.com> - 2016-03-30 11:56 +1100
    Re: Suggestion: make sequence and map interfaces more similar Random832 <random832@fastmail.com> - 2016-03-29 23:38 -0400
      Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-03-30 16:43 +1100
        Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-03-30 16:57 +1100
        Re: Suggestion: make sequence and map interfaces more similar Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-30 10:12 +0300
          Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-30 21:17 +1100
            Re: Suggestion: make sequence and map interfaces more similar Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-30 13:28 +0300
              Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-30 12:34 +0200
                Re: Suggestion: make sequence and map interfaces more similar Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-30 13:57 +0300
              Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-30 23:22 +1100
                Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-30 15:12 +0200
                Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-31 02:56 +1100
                Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-30 21:07 +0200
                Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-31 13:40 +1100
                Re: Suggestion: make sequence and map interfaces more similar Paul Rubin <no.email@nospam.invalid> - 2016-03-30 19:45 -0700
                Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-03-31 17:45 +1100
                Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-31 09:52 +0200
                Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-31 21:36 +1100
                Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-31 12:51 +0200
                Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-31 13:22 +0200
                Re: Suggestion: make sequence and map interfaces more similar Chris Angelico <rosuav@gmail.com> - 2016-03-31 22:57 +1100
                Re: Suggestion: make sequence and map interfaces more similar Marko Rauhamaa <marko@pacujo.net> - 2016-03-31 15:36 +0300
                Re: Suggestion: make sequence and map interfaces more similar Chris Angelico <rosuav@gmail.com> - 2016-03-31 23:48 +1100
                Re: Suggestion: make sequence and map interfaces more similar Marko Rauhamaa <marko@pacujo.net> - 2016-03-31 17:02 +0300
                Re: Suggestion: make sequence and map interfaces more similar Michael Selik <michael.selik@gmail.com> - 2016-04-01 04:19 -0400
                Re: Suggestion: make sequence and map interfaces more similar Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-31 15:55 +0300
                Re: Suggestion: make sequence and map interfaces more similar Marko Rauhamaa <marko@pacujo.net> - 2016-03-31 17:19 +0300
                Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-31 15:08 +0200
                Re: Suggestion: make sequence and map interfaces more similar Rustom Mody <rustompmody@gmail.com> - 2016-03-31 06:42 -0700
                Re: Suggestion: make sequence and map interfaces more similar Chris Angelico <rosuav@gmail.com> - 2016-04-01 00:11 +1100
                Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-31 14:17 +0100
                Re: Suggestion: make sequence and map interfaces more similar Random832 <random832@fastmail.com> - 2016-03-31 09:27 -0400
                Re: Suggestion: make sequence and map interfaces more similar Marko Rauhamaa <marko@pacujo.net> - 2016-03-31 17:13 +0300
                Re: Suggestion: make sequence and map interfaces more similar Terry Reedy <tjreedy@udel.edu> - 2016-03-31 13:41 -0400
                Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-31 15:12 +0100
                Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-04-01 09:59 +0200
                Re: Suggestion: make sequence and map interfaces more similar Tim Golden <mail@timgolden.me.uk> - 2016-04-01 09:27 +0100
                Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-04-01 21:38 +1100
                Re: Suggestion: make sequence and map interfaces more similar Marko Rauhamaa <marko@pacujo.net> - 2016-04-01 13:50 +0300
                Re: Suggestion: make sequence and map interfaces more similar Rustom Mody <rustompmody@gmail.com> - 2016-04-01 07:41 -0700
                Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-04-01 10:04 +0100
                Re: Suggestion: make sequence and map interfaces more similar Marco Sulla <mail.python.org@marco.sulla.e4ward.com> - 2016-03-30 21:35 +0200
                Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-30 21:31 +0100
            Re: Suggestion: make sequence and map interfaces more similar Manolo Martínez <manolo@austrohungaro.com> - 2016-03-30 12:26 +0200
              Re: Suggestion: make sequence and map interfaces more similar Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-30 13:40 +0300
                Re: Suggestion: make sequence and map interfaces more similar Manolo Martínez <manolo@austrohungaro.com> - 2016-03-30 12:50 +0200
                Re: Suggestion: make sequence and map interfaces more similar Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-30 14:21 +0300
                Re: Suggestion: make sequence and map interfaces more similar Marko Rauhamaa <marko@pacujo.net> - 2016-03-30 14:44 +0300
                Re: Suggestion: make sequence and map interfaces more similar Manolo Martínez <manolo@austrohungaro.com> - 2016-03-30 14:29 +0200
                Re: Suggestion: make sequence and map interfaces more similar Marko Rauhamaa <marko@pacujo.net> - 2016-03-30 15:55 +0300
                Re: Suggestion: make sequence and map interfaces more similar Manolo Martínez <manolo@austrohungaro.com> - 2016-03-30 15:13 +0200
                Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-30 23:27 +1100
                Re: Suggestion: make sequence and map interfaces more similar Marko Rauhamaa <marko@pacujo.net> - 2016-03-30 15:48 +0300
                Re: Suggestion: make sequence and map interfaces more similar Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-30 17:38 +0300
                Re: Suggestion: make sequence and map interfaces more similar Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-03-30 17:25 +0300
        Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-30 10:55 +0200
        Re: Suggestion: make sequence and map interfaces more similar Random832 <random832@fastmail.com> - 2016-03-30 08:50 -0400
          Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-31 03:02 +1100
            Re: Suggestion: make sequence and map interfaces more similar Random832 <random832@fastmail.com> - 2016-03-30 12:52 -0400
              Re: Suggestion: make sequence and map interfaces more similar Steven D'Aprano <steve@pearwood.info> - 2016-03-31 13:44 +1100
                Re: Suggestion: make sequence and map interfaces more similar Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-31 10:04 +0200
                Re: Suggestion: make sequence and map interfaces more similar Marco Sulla <mail.python.org@marco.sulla.e4ward.com> - 2016-03-31 13:58 +0200
                Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-31 13:30 +0100
                Re: Suggestion: make sequence and map interfaces more similar Marco Sulla <mail.python.org@marco.sulla.e4ward.com> - 2016-03-31 14:49 +0200
                Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-31 14:14 +0100
            Re: Suggestion: make sequence and map interfaces more similar Marco Sulla <mail.python.org@marco.sulla.e4ward.com> - 2016-03-30 22:00 +0200
            Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-30 21:36 +0100
    Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-30 08:03 +0100

csiph-web